//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension AppStream {
    // MARK: Enums

    public enum AccessEndpointType: String, CustomStringConvertible, Codable, _SotoSendable {
        case streaming = "STREAMING"
        public var description: String { return self.rawValue }
    }

    public enum Action: String, CustomStringConvertible, Codable, _SotoSendable {
        case clipboardCopyFromLocalDevice = "CLIPBOARD_COPY_FROM_LOCAL_DEVICE"
        case clipboardCopyToLocalDevice = "CLIPBOARD_COPY_TO_LOCAL_DEVICE"
        case domainPasswordSignin = "DOMAIN_PASSWORD_SIGNIN"
        case domainSmartCardSignin = "DOMAIN_SMART_CARD_SIGNIN"
        case fileDownload = "FILE_DOWNLOAD"
        case fileUpload = "FILE_UPLOAD"
        case printingToLocalDevice = "PRINTING_TO_LOCAL_DEVICE"
        public var description: String { return self.rawValue }
    }

    public enum AppVisibility: String, CustomStringConvertible, Codable, _SotoSendable {
        case all = "ALL"
        case associated = "ASSOCIATED"
        public var description: String { return self.rawValue }
    }

    public enum ApplicationAttribute: String, CustomStringConvertible, Codable, _SotoSendable {
        case launchParameters = "LAUNCH_PARAMETERS"
        case workingDirectory = "WORKING_DIRECTORY"
        public var description: String { return self.rawValue }
    }

    public enum AuthenticationType: String, CustomStringConvertible, Codable, _SotoSendable {
        case api = "API"
        case awsAd = "AWS_AD"
        case saml = "SAML"
        case userpool = "USERPOOL"
        public var description: String { return self.rawValue }
    }

    public enum CertificateBasedAuthStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        case enabledNoDirectoryLoginFallback = "ENABLED_NO_DIRECTORY_LOGIN_FALLBACK"
        public var description: String { return self.rawValue }
    }

    public enum FleetAttribute: String, CustomStringConvertible, Codable, _SotoSendable {
        case domainJoinInfo = "DOMAIN_JOIN_INFO"
        case iamRoleArn = "IAM_ROLE_ARN"
        case sessionScriptS3Location = "SESSION_SCRIPT_S3_LOCATION"
        case usbDeviceFilterStrings = "USB_DEVICE_FILTER_STRINGS"
        case vpcConfiguration = "VPC_CONFIGURATION"
        case vpcConfigurationSecurityGroupIds = "VPC_CONFIGURATION_SECURITY_GROUP_IDS"
        public var description: String { return self.rawValue }
    }

    public enum FleetErrorCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case domainJoinErrorAccessDenied = "DOMAIN_JOIN_ERROR_ACCESS_DENIED"
        case domainJoinErrorDsMachineAccountQuotaExceeded = "DOMAIN_JOIN_ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED"
        case domainJoinErrorFileNotFound = "DOMAIN_JOIN_ERROR_FILE_NOT_FOUND"
        case domainJoinErrorInvalidParameter = "DOMAIN_JOIN_ERROR_INVALID_PARAMETER"
        case domainJoinErrorLogonFailure = "DOMAIN_JOIN_ERROR_LOGON_FAILURE"
        case domainJoinErrorMoreData = "DOMAIN_JOIN_ERROR_MORE_DATA"
        case domainJoinErrorNoSuchDomain = "DOMAIN_JOIN_ERROR_NO_SUCH_DOMAIN"
        case domainJoinErrorNotSupported = "DOMAIN_JOIN_ERROR_NOT_SUPPORTED"
        case domainJoinInternalServiceError = "DOMAIN_JOIN_INTERNAL_SERVICE_ERROR"
        case domainJoinNerrInvalidWorkgroupName = "DOMAIN_JOIN_NERR_INVALID_WORKGROUP_NAME"
        case domainJoinNerrPasswordExpired = "DOMAIN_JOIN_NERR_PASSWORD_EXPIRED"
        case domainJoinNerrWorkstationNotStarted = "DOMAIN_JOIN_NERR_WORKSTATION_NOT_STARTED"
        case fleetInstanceProvisioningFailure = "FLEET_INSTANCE_PROVISIONING_FAILURE"
        case fleetStopped = "FLEET_STOPPED"
        case iamServiceRoleIsMissing = "IAM_SERVICE_ROLE_IS_MISSING"
        case iamServiceRoleMissingDescribeSecurityGroupsAction = "IAM_SERVICE_ROLE_MISSING_DESCRIBE_SECURITY_GROUPS_ACTION"
        case iamServiceRoleMissingDescribeSubnetAction = "IAM_SERVICE_ROLE_MISSING_DESCRIBE_SUBNET_ACTION"
        case iamServiceRoleMissingEniCreateAction = "IAM_SERVICE_ROLE_MISSING_ENI_CREATE_ACTION"
        case iamServiceRoleMissingEniDeleteAction = "IAM_SERVICE_ROLE_MISSING_ENI_DELETE_ACTION"
        case iamServiceRoleMissingEniDescribeAction = "IAM_SERVICE_ROLE_MISSING_ENI_DESCRIBE_ACTION"
        case igwNotAttached = "IGW_NOT_ATTACHED"
        case imageNotFound = "IMAGE_NOT_FOUND"
        case internalServiceError = "INTERNAL_SERVICE_ERROR"
        case invalidSubnetConfiguration = "INVALID_SUBNET_CONFIGURATION"
        case machineRoleIsMissing = "MACHINE_ROLE_IS_MISSING"
        case networkInterfaceLimitExceeded = "NETWORK_INTERFACE_LIMIT_EXCEEDED"
        case securityGroupsNotFound = "SECURITY_GROUPS_NOT_FOUND"
        case stsDisabledInRegion = "STS_DISABLED_IN_REGION"
        case subnetHasInsufficientIpAddresses = "SUBNET_HAS_INSUFFICIENT_IP_ADDRESSES"
        case subnetNotFound = "SUBNET_NOT_FOUND"
        public var description: String { return self.rawValue }
    }

    public enum FleetState: String, CustomStringConvertible, Codable, _SotoSendable {
        case running = "RUNNING"
        case starting = "STARTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        public var description: String { return self.rawValue }
    }

    public enum FleetType: String, CustomStringConvertible, Codable, _SotoSendable {
        case alwaysOn = "ALWAYS_ON"
        case elastic = "ELASTIC"
        case onDemand = "ON_DEMAND"
        public var description: String { return self.rawValue }
    }

    public enum ImageBuilderState: String, CustomStringConvertible, Codable, _SotoSendable {
        case deleting = "DELETING"
        case failed = "FAILED"
        case pending = "PENDING"
        case pendingQualification = "PENDING_QUALIFICATION"
        case rebooting = "REBOOTING"
        case running = "RUNNING"
        case snapshotting = "SNAPSHOTTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        case updating = "UPDATING"
        case updatingAgent = "UPDATING_AGENT"
        public var description: String { return self.rawValue }
    }

    public enum ImageBuilderStateChangeReasonCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case imageUnavailable = "IMAGE_UNAVAILABLE"
        case internalError = "INTERNAL_ERROR"
        public var description: String { return self.rawValue }
    }

    public enum ImageState: String, CustomStringConvertible, Codable, _SotoSendable {
        case available = "AVAILABLE"
        case copying = "COPYING"
        case creating = "CREATING"
        case deleting = "DELETING"
        case failed = "FAILED"
        case importing = "IMPORTING"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum ImageStateChangeReasonCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case imageBuilderNotAvailable = "IMAGE_BUILDER_NOT_AVAILABLE"
        case imageCopyFailure = "IMAGE_COPY_FAILURE"
        case internalError = "INTERNAL_ERROR"
        public var description: String { return self.rawValue }
    }

    public enum MessageAction: String, CustomStringConvertible, Codable, _SotoSendable {
        case resend = "RESEND"
        case suppress = "SUPPRESS"
        public var description: String { return self.rawValue }
    }

    public enum Permission: String, CustomStringConvertible, Codable, _SotoSendable {
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    public enum PlatformType: String, CustomStringConvertible, Codable, _SotoSendable {
        case amazonLinux2 = "AMAZON_LINUX2"
        case windows = "WINDOWS"
        case windowsServer2016 = "WINDOWS_SERVER_2016"
        case windowsServer2019 = "WINDOWS_SERVER_2019"
        public var description: String { return self.rawValue }
    }

    public enum PreferredProtocol: String, CustomStringConvertible, Codable, _SotoSendable {
        case tcp = "TCP"
        case udp = "UDP"
        public var description: String { return self.rawValue }
    }

    public enum SessionConnectionState: String, CustomStringConvertible, Codable, _SotoSendable {
        case connected = "CONNECTED"
        case notConnected = "NOT_CONNECTED"
        public var description: String { return self.rawValue }
    }

    public enum SessionState: String, CustomStringConvertible, Codable, _SotoSendable {
        case active = "ACTIVE"
        case expired = "EXPIRED"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum StackAttribute: String, CustomStringConvertible, Codable, _SotoSendable {
        case accessEndpoints = "ACCESS_ENDPOINTS"
        case embedHostDomains = "EMBED_HOST_DOMAINS"
        case feedbackUrl = "FEEDBACK_URL"
        case iamRoleArn = "IAM_ROLE_ARN"
        case redirectUrl = "REDIRECT_URL"
        case storageConnectorGoogleDrive = "STORAGE_CONNECTOR_GOOGLE_DRIVE"
        case storageConnectorHomefolders = "STORAGE_CONNECTOR_HOMEFOLDERS"
        case storageConnectorOneDrive = "STORAGE_CONNECTOR_ONE_DRIVE"
        case storageConnectors = "STORAGE_CONNECTORS"
        case streamingExperienceSettings = "STREAMING_EXPERIENCE_SETTINGS"
        case themeName = "THEME_NAME"
        case userSettings = "USER_SETTINGS"
        public var description: String { return self.rawValue }
    }

    public enum StackErrorCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case internalServiceError = "INTERNAL_SERVICE_ERROR"
        case storageConnectorError = "STORAGE_CONNECTOR_ERROR"
        public var description: String { return self.rawValue }
    }

    public enum StorageConnectorType: String, CustomStringConvertible, Codable, _SotoSendable {
        case googleDrive = "GOOGLE_DRIVE"
        case homefolders = "HOMEFOLDERS"
        case oneDrive = "ONE_DRIVE"
        public var description: String { return self.rawValue }
    }

    public enum StreamView: String, CustomStringConvertible, Codable, _SotoSendable {
        case app = "APP"
        case desktop = "DESKTOP"
        public var description: String { return self.rawValue }
    }

    public enum UsageReportExecutionErrorCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case accessDenied = "ACCESS_DENIED"
        case internalServiceError = "INTERNAL_SERVICE_ERROR"
        case resourceNotFound = "RESOURCE_NOT_FOUND"
        public var description: String { return self.rawValue }
    }

    public enum UsageReportSchedule: String, CustomStringConvertible, Codable, _SotoSendable {
        case daily = "DAILY"
        public var description: String { return self.rawValue }
    }

    public enum UserStackAssociationErrorCode: String, CustomStringConvertible, Codable, _SotoSendable {
        case directoryNotFound = "DIRECTORY_NOT_FOUND"
        case internalError = "INTERNAL_ERROR"
        case stackNotFound = "STACK_NOT_FOUND"
        case userNameNotFound = "USER_NAME_NOT_FOUND"
        public var description: String { return self.rawValue }
    }

    public enum VisibilityType: String, CustomStringConvertible, Codable, _SotoSendable {
        case `private` = "PRIVATE"
        case `public` = "PUBLIC"
        case shared = "SHARED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessEndpoint: AWSEncodableShape & AWSDecodableShape {
        /// The type of interface endpoint.
        public let endpointType: AccessEndpointType
        /// The identifier (ID) of the VPC in which the interface endpoint is used.
        public let vpceId: String?

        public init(endpointType: AccessEndpointType, vpceId: String? = nil) {
            self.endpointType = endpointType
            self.vpceId = vpceId
        }

        public func validate(name: String) throws {
            try self.validate(self.vpceId, name: "vpceId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case endpointType = "EndpointType"
            case vpceId = "VpceId"
        }
    }

    public struct AppBlock: AWSDecodableShape {
        /// The ARN of the app block.
        public let arn: String
        /// The created time of the app block.
        public let createdTime: Date?
        /// The description of the app block.
        public let description: String?
        /// The display name of the app block.
        public let displayName: String?
        /// The name of the app block.
        public let name: String
        /// The setup script details of the app block.
        public let setupScriptDetails: ScriptDetails
        /// The source S3 location of the app block.
        public let sourceS3Location: S3Location?

        public init(arn: String, createdTime: Date? = nil, description: String? = nil, displayName: String? = nil, name: String, setupScriptDetails: ScriptDetails, sourceS3Location: S3Location? = nil) {
            self.arn = arn
            self.createdTime = createdTime
            self.description = description
            self.displayName = displayName
            self.name = name
            self.setupScriptDetails = setupScriptDetails
            self.sourceS3Location = sourceS3Location
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case description = "Description"
            case displayName = "DisplayName"
            case name = "Name"
            case setupScriptDetails = "SetupScriptDetails"
            case sourceS3Location = "SourceS3Location"
        }
    }

    public struct Application: AWSDecodableShape {
        /// The app block ARN of the application.
        public let appBlockArn: String?
        /// The ARN of the application.
        public let arn: String?
        /// The time at which the application was created within the app block.
        public let createdTime: Date?
        /// The description of the application.
        public let description: String?
        /// The application name to display.
        public let displayName: String?
        /// If there is a problem, the application can be disabled after image creation.
        public let enabled: Bool?
        /// The S3 location of the application icon.
        public let iconS3Location: S3Location?
        /// The URL for the application icon. This URL might be time-limited.
        public let iconURL: String?
        /// The instance families for the application.
        public let instanceFamilies: [String]?
        /// The arguments that are passed to the application at launch.
        public let launchParameters: String?
        /// The path to the application executable in the instance.
        public let launchPath: String?
        /// Additional attributes that describe the application.
        public let metadata: [String: String]?
        /// The name of the application.
        public let name: String?
        /// The platforms on which the application can run.
        public let platforms: [PlatformType]?
        /// The working directory for the application.
        public let workingDirectory: String?

        public init(appBlockArn: String? = nil, arn: String? = nil, createdTime: Date? = nil, description: String? = nil, displayName: String? = nil, enabled: Bool? = nil, iconS3Location: S3Location? = nil, iconURL: String? = nil, instanceFamilies: [String]? = nil, launchParameters: String? = nil, launchPath: String? = nil, metadata: [String: String]? = nil, name: String? = nil, platforms: [PlatformType]? = nil, workingDirectory: String? = nil) {
            self.appBlockArn = appBlockArn
            self.arn = arn
            self.createdTime = createdTime
            self.description = description
            self.displayName = displayName
            self.enabled = enabled
            self.iconS3Location = iconS3Location
            self.iconURL = iconURL
            self.instanceFamilies = instanceFamilies
            self.launchParameters = launchParameters
            self.launchPath = launchPath
            self.metadata = metadata
            self.name = name
            self.platforms = platforms
            self.workingDirectory = workingDirectory
        }

        private enum CodingKeys: String, CodingKey {
            case appBlockArn = "AppBlockArn"
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case description = "Description"
            case displayName = "DisplayName"
            case enabled = "Enabled"
            case iconS3Location = "IconS3Location"
            case iconURL = "IconURL"
            case instanceFamilies = "InstanceFamilies"
            case launchParameters = "LaunchParameters"
            case launchPath = "LaunchPath"
            case metadata = "Metadata"
            case name = "Name"
            case platforms = "Platforms"
            case workingDirectory = "WorkingDirectory"
        }
    }

    public struct ApplicationFleetAssociation: AWSDecodableShape {
        /// The ARN of the application associated with the fleet.
        public let applicationArn: String
        /// The name of the fleet associated with the application.
        public let fleetName: String

        public init(applicationArn: String, fleetName: String) {
            self.applicationArn = applicationArn
            self.fleetName = fleetName
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "ApplicationArn"
            case fleetName = "FleetName"
        }
    }

    public struct ApplicationSettings: AWSEncodableShape {
        /// Enables or disables persistent application settings for users during their streaming sessions.
        public let enabled: Bool
        /// The path prefix for the S3 bucket where users’ persistent application settings are stored. You can allow the same persistent application settings to be used across multiple stacks by specifying the same settings group for each stack.
        public let settingsGroup: String?

        public init(enabled: Bool = false, settingsGroup: String? = nil) {
            self.enabled = enabled
            self.settingsGroup = settingsGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.settingsGroup, name: "settingsGroup", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "Enabled"
            case settingsGroup = "SettingsGroup"
        }
    }

    public struct ApplicationSettingsResponse: AWSDecodableShape {
        /// Specifies whether persistent application settings are enabled for users during their streaming sessions.
        public let enabled: Bool?
        /// The S3 bucket where users’ persistent application settings are stored. When persistent application settings are enabled for the first time for an account in an AWS Region, an S3 bucket is created. The bucket is unique to the AWS account and the Region.
        public let s3BucketName: String?
        /// The path prefix for the S3 bucket where users’ persistent application settings are stored.
        public let settingsGroup: String?

        public init(enabled: Bool? = nil, s3BucketName: String? = nil, settingsGroup: String? = nil) {
            self.enabled = enabled
            self.s3BucketName = s3BucketName
            self.settingsGroup = settingsGroup
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "Enabled"
            case s3BucketName = "S3BucketName"
            case settingsGroup = "SettingsGroup"
        }
    }

    public struct AssociateApplicationFleetRequest: AWSEncodableShape {
        /// The ARN of the application.
        public let applicationArn: String
        /// The name of the fleet.
        public let fleetName: String

        public init(applicationArn: String, fleetName: String) {
            self.applicationArn = applicationArn
            self.fleetName = fleetName
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationArn, name: "applicationArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.fleetName, name: "fleetName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "ApplicationArn"
            case fleetName = "FleetName"
        }
    }

    public struct AssociateApplicationFleetResult: AWSDecodableShape {
        /// If fleet name is specified, this returns the list of applications that are associated to it. If application ARN is specified, this returns the list of fleets to which it is associated.
        public let applicationFleetAssociation: ApplicationFleetAssociation?

        public init(applicationFleetAssociation: ApplicationFleetAssociation? = nil) {
            self.applicationFleetAssociation = applicationFleetAssociation
        }

        private enum CodingKeys: String, CodingKey {
            case applicationFleetAssociation = "ApplicationFleetAssociation"
        }
    }

    public struct AssociateApplicationToEntitlementRequest: AWSEncodableShape {
        /// The identifier of the application.
        public let applicationIdentifier: String
        /// The name of the entitlement.
        public let entitlementName: String
        /// The name of the stack.
        public let stackName: String

        public init(applicationIdentifier: String, entitlementName: String, stackName: String) {
            self.applicationIdentifier = applicationIdentifier
            self.entitlementName = entitlementName
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationIdentifier, name: "applicationIdentifier", parent: name, min: 1)
            try self.validate(self.entitlementName, name: "entitlementName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationIdentifier = "ApplicationIdentifier"
            case entitlementName = "EntitlementName"
            case stackName = "StackName"
        }
    }

    public struct AssociateApplicationToEntitlementResult: AWSDecodableShape {
        public init() {}
    }

    public struct AssociateFleetRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let fleetName: String
        /// The name of the stack.
        public let stackName: String

        public init(fleetName: String, stackName: String) {
            self.fleetName = fleetName
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetName = "FleetName"
            case stackName = "StackName"
        }
    }

    public struct AssociateFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct BatchAssociateUserStackRequest: AWSEncodableShape {
        /// The list of UserStackAssociation objects.
        public let userStackAssociations: [UserStackAssociation]

        public init(userStackAssociations: [UserStackAssociation]) {
            self.userStackAssociations = userStackAssociations
        }

        public func validate(name: String) throws {
            try self.userStackAssociations.forEach {
                try $0.validate(name: "\(name).userStackAssociations[]")
            }
            try self.validate(self.userStackAssociations, name: "userStackAssociations", parent: name, max: 25)
            try self.validate(self.userStackAssociations, name: "userStackAssociations", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case userStackAssociations = "UserStackAssociations"
        }
    }

    public struct BatchAssociateUserStackResult: AWSDecodableShape {
        /// The list of UserStackAssociationError objects.
        public let errors: [UserStackAssociationError]?

        public init(errors: [UserStackAssociationError]? = nil) {
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case errors
        }
    }

    public struct BatchDisassociateUserStackRequest: AWSEncodableShape {
        /// The list of UserStackAssociation objects.
        public let userStackAssociations: [UserStackAssociation]

        public init(userStackAssociations: [UserStackAssociation]) {
            self.userStackAssociations = userStackAssociations
        }

        public func validate(name: String) throws {
            try self.userStackAssociations.forEach {
                try $0.validate(name: "\(name).userStackAssociations[]")
            }
            try self.validate(self.userStackAssociations, name: "userStackAssociations", parent: name, max: 25)
            try self.validate(self.userStackAssociations, name: "userStackAssociations", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case userStackAssociations = "UserStackAssociations"
        }
    }

    public struct BatchDisassociateUserStackResult: AWSDecodableShape {
        /// The list of UserStackAssociationError objects.
        public let errors: [UserStackAssociationError]?

        public init(errors: [UserStackAssociationError]? = nil) {
            self.errors = errors
        }

        private enum CodingKeys: String, CodingKey {
            case errors
        }
    }

    public struct CertificateBasedAuthProperties: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the AWS Certificate Manager Private CA resource.
        public let certificateAuthorityArn: String?
        /// The status of the certificate-based authentication properties.
        public let status: CertificateBasedAuthStatus?

        public init(certificateAuthorityArn: String? = nil, status: CertificateBasedAuthStatus? = nil) {
            self.certificateAuthorityArn = certificateAuthorityArn
            self.status = status
        }

        public func validate(name: String) throws {
            try self.validate(self.certificateAuthorityArn, name: "certificateAuthorityArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateAuthorityArn = "CertificateAuthorityArn"
            case status = "Status"
        }
    }

    public struct ComputeCapacity: AWSEncodableShape {
        /// The desired number of streaming instances.
        public let desiredInstances: Int

        public init(desiredInstances: Int) {
            self.desiredInstances = desiredInstances
        }

        private enum CodingKeys: String, CodingKey {
            case desiredInstances = "DesiredInstances"
        }
    }

    public struct ComputeCapacityStatus: AWSDecodableShape {
        /// The number of currently available instances that can be used to stream sessions.
        public let available: Int?
        /// The desired number of streaming instances.
        public let desired: Int
        /// The number of instances in use for streaming.
        public let inUse: Int?
        /// The total number of simultaneous streaming instances that are running.
        public let running: Int?

        public init(available: Int? = nil, desired: Int, inUse: Int? = nil, running: Int? = nil) {
            self.available = available
            self.desired = desired
            self.inUse = inUse
            self.running = running
        }

        private enum CodingKeys: String, CodingKey {
            case available = "Available"
            case desired = "Desired"
            case inUse = "InUse"
            case running = "Running"
        }
    }

    public struct CopyImageRequest: AWSEncodableShape {
        /// The description that the image will have when it is copied to the destination.
        public let destinationImageDescription: String?
        /// The name that the image will have when it is copied to the destination.
        public let destinationImageName: String
        /// The destination region to which the image will be copied. This parameter is required, even if you are copying an image within the same region.
        public let destinationRegion: String
        /// The name of the image to copy.
        public let sourceImageName: String

        public init(destinationImageDescription: String? = nil, destinationImageName: String, destinationRegion: String, sourceImageName: String) {
            self.destinationImageDescription = destinationImageDescription
            self.destinationImageName = destinationImageName
            self.destinationRegion = destinationRegion
            self.sourceImageName = sourceImageName
        }

        public func validate(name: String) throws {
            try self.validate(self.destinationImageDescription, name: "destinationImageDescription", parent: name, max: 256)
            try self.validate(self.destinationImageName, name: "destinationImageName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.destinationRegion, name: "destinationRegion", parent: name, max: 32)
            try self.validate(self.destinationRegion, name: "destinationRegion", parent: name, min: 1)
            try self.validate(self.sourceImageName, name: "sourceImageName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case destinationImageDescription = "DestinationImageDescription"
            case destinationImageName = "DestinationImageName"
            case destinationRegion = "DestinationRegion"
            case sourceImageName = "SourceImageName"
        }
    }

    public struct CopyImageResponse: AWSDecodableShape {
        /// The name of the destination image.
        public let destinationImageName: String?

        public init(destinationImageName: String? = nil) {
            self.destinationImageName = destinationImageName
        }

        private enum CodingKeys: String, CodingKey {
            case destinationImageName = "DestinationImageName"
        }
    }

    public struct CreateAppBlockRequest: AWSEncodableShape {
        /// The description of the app block.
        public let description: String?
        /// The display name of the app block. This is not displayed to the user.
        public let displayName: String?
        /// The name of the app block.
        public let name: String
        /// The setup script details of the app block.
        public let setupScriptDetails: ScriptDetails
        /// The source S3 location of the app block.
        public let sourceS3Location: S3Location
        /// The tags assigned to the app block.
        public let tags: [String: String]?

        public init(description: String? = nil, displayName: String? = nil, name: String, setupScriptDetails: ScriptDetails, sourceS3Location: S3Location, tags: [String: String]? = nil) {
            self.description = description
            self.displayName = displayName
            self.name = name
            self.setupScriptDetails = setupScriptDetails
            self.sourceS3Location = sourceS3Location
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.setupScriptDetails.validate(name: "\(name).setupScriptDetails")
            try self.sourceS3Location.validate(name: "\(name).sourceS3Location")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case displayName = "DisplayName"
            case name = "Name"
            case setupScriptDetails = "SetupScriptDetails"
            case sourceS3Location = "SourceS3Location"
            case tags = "Tags"
        }
    }

    public struct CreateAppBlockResult: AWSDecodableShape {
        /// The app block.
        public let appBlock: AppBlock?

        public init(appBlock: AppBlock? = nil) {
            self.appBlock = appBlock
        }

        private enum CodingKeys: String, CodingKey {
            case appBlock = "AppBlock"
        }
    }

    public struct CreateApplicationRequest: AWSEncodableShape {
        /// The app block ARN to which the application should be associated
        public let appBlockArn: String
        /// The description of the application.
        public let description: String?
        /// The display name of the application. This name is visible to users in the application catalog.
        public let displayName: String?
        /// The location in S3 of the application icon.
        public let iconS3Location: S3Location
        /// The instance families the application supports. Valid values are GENERAL_PURPOSE and GRAPHICS_G4.
        public let instanceFamilies: [String]
        /// The launch parameters of the application.
        public let launchParameters: String?
        /// The launch path of the application.
        public let launchPath: String
        /// The name of the application. This name is visible to users when display name is not specified.
        public let name: String
        /// The platforms the application supports. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.
        public let platforms: [PlatformType]
        /// The tags assigned to the application.
        public let tags: [String: String]?
        /// The working directory of the application.
        public let workingDirectory: String?

        public init(appBlockArn: String, description: String? = nil, displayName: String? = nil, iconS3Location: S3Location, instanceFamilies: [String], launchParameters: String? = nil, launchPath: String, name: String, platforms: [PlatformType], tags: [String: String]? = nil, workingDirectory: String? = nil) {
            self.appBlockArn = appBlockArn
            self.description = description
            self.displayName = displayName
            self.iconS3Location = iconS3Location
            self.instanceFamilies = instanceFamilies
            self.launchParameters = launchParameters
            self.launchPath = launchPath
            self.name = name
            self.platforms = platforms
            self.tags = tags
            self.workingDirectory = workingDirectory
        }

        public func validate(name: String) throws {
            try self.validate(self.appBlockArn, name: "appBlockArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.iconS3Location.validate(name: "\(name).iconS3Location")
            try self.instanceFamilies.forEach {
                try validate($0, name: "instanceFamilies[]", parent: name, min: 1)
            }
            try self.validate(self.launchParameters, name: "launchParameters", parent: name, min: 1)
            try self.validate(self.launchPath, name: "launchPath", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.platforms, name: "platforms", parent: name, max: 4)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.validate(self.workingDirectory, name: "workingDirectory", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case appBlockArn = "AppBlockArn"
            case description = "Description"
            case displayName = "DisplayName"
            case iconS3Location = "IconS3Location"
            case instanceFamilies = "InstanceFamilies"
            case launchParameters = "LaunchParameters"
            case launchPath = "LaunchPath"
            case name = "Name"
            case platforms = "Platforms"
            case tags = "Tags"
            case workingDirectory = "WorkingDirectory"
        }
    }

    public struct CreateApplicationResult: AWSDecodableShape {
        public let application: Application?

        public init(application: Application? = nil) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "Application"
        }
    }

    public struct CreateDirectoryConfigRequest: AWSEncodableShape {
        /// The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is Enabled . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. Enabled_no_directory_login_fallback enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.
        public let certificateBasedAuthProperties: CertificateBasedAuthProperties?
        /// The fully qualified name of the directory (for example, corp.example.com).
        public let directoryName: String
        /// The distinguished names of the organizational units for computer accounts.
        public let organizationalUnitDistinguishedNames: [String]
        /// The credentials for the service account used by the fleet or image builder to connect to the directory.
        public let serviceAccountCredentials: ServiceAccountCredentials?

        public init(certificateBasedAuthProperties: CertificateBasedAuthProperties? = nil, directoryName: String, organizationalUnitDistinguishedNames: [String], serviceAccountCredentials: ServiceAccountCredentials? = nil) {
            self.certificateBasedAuthProperties = certificateBasedAuthProperties
            self.directoryName = directoryName
            self.organizationalUnitDistinguishedNames = organizationalUnitDistinguishedNames
            self.serviceAccountCredentials = serviceAccountCredentials
        }

        public func validate(name: String) throws {
            try self.certificateBasedAuthProperties?.validate(name: "\(name).certificateBasedAuthProperties")
            try self.organizationalUnitDistinguishedNames.forEach {
                try validate($0, name: "organizationalUnitDistinguishedNames[]", parent: name, max: 2000)
            }
            try self.serviceAccountCredentials?.validate(name: "\(name).serviceAccountCredentials")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateBasedAuthProperties = "CertificateBasedAuthProperties"
            case directoryName = "DirectoryName"
            case organizationalUnitDistinguishedNames = "OrganizationalUnitDistinguishedNames"
            case serviceAccountCredentials = "ServiceAccountCredentials"
        }
    }

    public struct CreateDirectoryConfigResult: AWSDecodableShape {
        /// Information about the directory configuration.
        public let directoryConfig: DirectoryConfig?

        public init(directoryConfig: DirectoryConfig? = nil) {
            self.directoryConfig = directoryConfig
        }

        private enum CodingKeys: String, CodingKey {
            case directoryConfig = "DirectoryConfig"
        }
    }

    public struct CreateEntitlementRequest: AWSEncodableShape {
        /// Specifies whether all or selected apps are entitled.
        public let appVisibility: AppVisibility
        /// The attributes of the entitlement.
        public let attributes: [EntitlementAttribute]
        /// The description of the entitlement.
        public let description: String?
        /// The name of the entitlement.
        public let name: String
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(appVisibility: AppVisibility, attributes: [EntitlementAttribute], description: String? = nil, name: String, stackName: String) {
            self.appVisibility = appVisibility
            self.attributes = attributes
            self.description = description
            self.name = name
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.attributes.forEach {
                try $0.validate(name: "\(name).attributes[]")
            }
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case appVisibility = "AppVisibility"
            case attributes = "Attributes"
            case description = "Description"
            case name = "Name"
            case stackName = "StackName"
        }
    }

    public struct CreateEntitlementResult: AWSDecodableShape {
        /// The entitlement.
        public let entitlement: Entitlement?

        public init(entitlement: Entitlement? = nil) {
            self.entitlement = entitlement
        }

        private enum CodingKeys: String, CodingKey {
            case entitlement = "Entitlement"
        }
    }

    public struct CreateFleetRequest: AWSEncodableShape {
        /// The desired capacity for the fleet. This is not allowed for Elastic fleets. For Elastic fleets, specify MaxConcurrentSessions instead.
        public let computeCapacity: ComputeCapacity?
        /// The description to display.
        public let description: String?
        /// The amount of time that a streaming session remains active after users disconnect. If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance.  Specify a value between 60 and 360000.
        public let disconnectTimeoutInSeconds: Int?
        /// The fleet name to display.
        public let displayName: String?
        /// The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain. This is not allowed for Elastic fleets.
        public let domainJoinInfo: DomainJoinInfo?
        /// Enables or disables default internet access for the fleet.
        public let enableDefaultInternetAccess: Bool?
        /// The fleet type.  ALWAYS_ON  Provides users with instant-on access to their apps. You are charged for all running instances in your fleet, even if no users are streaming apps.  ON_DEMAND  Provide users with access to applications after they connect, which takes one to two minutes. You are charged for instance streaming when users are connected and a small hourly fee for instances that are not streaming apps.
        public let fleetType: FleetType?
        /// The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume a role, a fleet instance calls the AWS Security Token Service (STS) AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.  For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide.
        public let iamRoleArn: String?
        /// The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the DisconnectTimeoutInSeconds time interval begins. Users are notified before they are disconnected due to inactivity. If they try to reconnect to the streaming session before the time interval specified in DisconnectTimeoutInSeconds elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in IdleDisconnectTimeoutInSeconds elapses, they are disconnected. To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.  If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don't do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity.
        public let idleDisconnectTimeoutInSeconds: Int?
        /// The ARN of the public, private, or shared image to use.
        public let imageArn: String?
        /// The name of the image used to create the fleet.
        public let imageName: String?
        /// The instance type to use when launching fleet instances. The following instance types are available:       stream.standard.small   stream.standard.medium   stream.standard.large   stream.standard.xlarge   stream.standard.2xlarge   stream.compute.large   stream.compute.xlarge   stream.compute.2xlarge   stream.compute.4xlarge   stream.compute.8xlarge   stream.memory.large   stream.memory.xlarge   stream.memory.2xlarge   stream.memory.4xlarge   stream.memory.8xlarge   stream.memory.z1d.large   stream.memory.z1d.xlarge   stream.memory.z1d.2xlarge   stream.memory.z1d.3xlarge   stream.memory.z1d.6xlarge   stream.memory.z1d.12xlarge   stream.graphics-design.large   stream.graphics-design.xlarge   stream.graphics-design.2xlarge   stream.graphics-design.4xlarge   stream.graphics-desktop.2xlarge   stream.graphics.g4dn.xlarge   stream.graphics.g4dn.2xlarge   stream.graphics.g4dn.4xlarge   stream.graphics.g4dn.8xlarge   stream.graphics.g4dn.12xlarge   stream.graphics.g4dn.16xlarge   stream.graphics-pro.4xlarge   stream.graphics-pro.8xlarge   stream.graphics-pro.16xlarge   The following instance types are available for Elastic fleets:   stream.standard.small   stream.standard.medium   stream.standard.large   stream.standard.xlarge   stream.standard.2xlarge
        public let instanceType: String
        /// The maximum concurrent sessions of the Elastic fleet. This is required for Elastic fleets, and not allowed for other fleet types.
        public let maxConcurrentSessions: Int?
        /// The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance. Specify a value between 600 and 360000.
        public let maxUserDurationInSeconds: Int?
        /// A unique name for the fleet.
        public let name: String
        /// The fleet platform. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.
        public let platform: PlatformType?
        /// The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets.
        public let sessionScriptS3Location: S3Location?
        /// The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When APP is specified, only the windows of applications opened by users display. When DESKTOP is specified, the standard desktop that is provided by the operating system displays.  The default value is APP.
        public let streamView: StreamView?
        /// The tags to associate with the fleet. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.   If you do not specify a value, the value is set to an empty string.  Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:  _ . : / = + \ - @  For more information, see Tagging Your Resources in the Amazon AppStream 2.0 Administration Guide.
        public let tags: [String: String]?
        /// The USB device filter strings that specify which USB devices a user can redirect to the fleet streaming session, when using the Windows native client. This is allowed but not required for Elastic fleets.
        public let usbDeviceFilterStrings: [String]?
        /// The VPC configuration for the fleet. This is required for Elastic fleets, but not required for other fleet types. Elastic fleets require that you specify at least two subnets in different availability zones.
        public let vpcConfig: VpcConfig?

        public init(computeCapacity: ComputeCapacity? = nil, description: String? = nil, disconnectTimeoutInSeconds: Int? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, fleetType: FleetType? = nil, iamRoleArn: String? = nil, idleDisconnectTimeoutInSeconds: Int? = nil, imageArn: String? = nil, imageName: String? = nil, instanceType: String, maxConcurrentSessions: Int? = nil, maxUserDurationInSeconds: Int? = nil, name: String, platform: PlatformType? = nil, sessionScriptS3Location: S3Location? = nil, streamView: StreamView? = nil, tags: [String: String]? = nil, usbDeviceFilterStrings: [String]? = nil, vpcConfig: VpcConfig? = nil) {
            self.computeCapacity = computeCapacity
            self.description = description
            self.disconnectTimeoutInSeconds = disconnectTimeoutInSeconds
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.fleetType = fleetType
            self.iamRoleArn = iamRoleArn
            self.idleDisconnectTimeoutInSeconds = idleDisconnectTimeoutInSeconds
            self.imageArn = imageArn
            self.imageName = imageName
            self.instanceType = instanceType
            self.maxConcurrentSessions = maxConcurrentSessions
            self.maxUserDurationInSeconds = maxUserDurationInSeconds
            self.name = name
            self.platform = platform
            self.sessionScriptS3Location = sessionScriptS3Location
            self.streamView = streamView
            self.tags = tags
            self.usbDeviceFilterStrings = usbDeviceFilterStrings
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.domainJoinInfo?.validate(name: "\(name).domainJoinInfo")
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageArn, name: "imageArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageName, name: "imageName", parent: name, min: 1)
            try self.validate(self.instanceType, name: "instanceType", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.sessionScriptS3Location?.validate(name: "\(name).sessionScriptS3Location")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.usbDeviceFilterStrings?.forEach {
                try validate($0, name: "usbDeviceFilterStrings[]", parent: name, max: 100)
                try validate($0, name: "usbDeviceFilterStrings[]", parent: name, pattern: "^((\\w*)\\s*(\\w*)\\s*\\,\\s*(\\w*)\\s*\\,\\s*\\*?(\\w*)\\s*\\,\\s*\\*?(\\w*)\\s*\\,\\s*\\*?\\d*\\s*\\,\\s*\\*?\\d*\\s*\\,\\s*[0-1]\\s*\\,\\s*[0-1]\\s*)$")
            }
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case computeCapacity = "ComputeCapacity"
            case description = "Description"
            case disconnectTimeoutInSeconds = "DisconnectTimeoutInSeconds"
            case displayName = "DisplayName"
            case domainJoinInfo = "DomainJoinInfo"
            case enableDefaultInternetAccess = "EnableDefaultInternetAccess"
            case fleetType = "FleetType"
            case iamRoleArn = "IamRoleArn"
            case idleDisconnectTimeoutInSeconds = "IdleDisconnectTimeoutInSeconds"
            case imageArn = "ImageArn"
            case imageName = "ImageName"
            case instanceType = "InstanceType"
            case maxConcurrentSessions = "MaxConcurrentSessions"
            case maxUserDurationInSeconds = "MaxUserDurationInSeconds"
            case name = "Name"
            case platform = "Platform"
            case sessionScriptS3Location = "SessionScriptS3Location"
            case streamView = "StreamView"
            case tags = "Tags"
            case usbDeviceFilterStrings = "UsbDeviceFilterStrings"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CreateFleetResult: AWSDecodableShape {
        /// Information about the fleet.
        public let fleet: Fleet?

        public init(fleet: Fleet? = nil) {
            self.fleet = fleet
        }

        private enum CodingKeys: String, CodingKey {
            case fleet = "Fleet"
        }
    }

    public struct CreateImageBuilderRequest: AWSEncodableShape {
        /// The list of interface VPC endpoint (interface endpoint) objects. Administrators can connect to the image builder only through the specified endpoints.
        public let accessEndpoints: [AccessEndpoint]?
        /// The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify [LATEST].
        public let appstreamAgentVersion: String?
        /// The description to display.
        public let description: String?
        /// The image builder name to display.
        public let displayName: String?
        /// The name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain.
        public let domainJoinInfo: DomainJoinInfo?
        /// Enables or disables default internet access for the image builder.
        public let enableDefaultInternetAccess: Bool?
        /// The Amazon Resource Name (ARN) of the IAM role to apply to the image builder. To assume a role, the image builder calls the AWS Security Token Service (STS) AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.  For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide.
        public let iamRoleArn: String?
        /// The ARN of the public, private, or shared image to use.
        public let imageArn: String?
        /// The name of the image used to create the image builder.
        public let imageName: String?
        /// The instance type to use when launching the image builder. The following instance types are available:      stream.standard.small   stream.standard.medium   stream.standard.large   stream.compute.large   stream.compute.xlarge   stream.compute.2xlarge   stream.compute.4xlarge   stream.compute.8xlarge   stream.memory.large   stream.memory.xlarge   stream.memory.2xlarge   stream.memory.4xlarge   stream.memory.8xlarge   stream.memory.z1d.large   stream.memory.z1d.xlarge   stream.memory.z1d.2xlarge   stream.memory.z1d.3xlarge   stream.memory.z1d.6xlarge   stream.memory.z1d.12xlarge   stream.graphics-design.large   stream.graphics-design.xlarge   stream.graphics-design.2xlarge   stream.graphics-design.4xlarge   stream.graphics-desktop.2xlarge   stream.graphics.g4dn.xlarge   stream.graphics.g4dn.2xlarge   stream.graphics.g4dn.4xlarge   stream.graphics.g4dn.8xlarge   stream.graphics.g4dn.12xlarge   stream.graphics.g4dn.16xlarge   stream.graphics-pro.4xlarge   stream.graphics-pro.8xlarge   stream.graphics-pro.16xlarge
        public let instanceType: String
        /// A unique name for the image builder.
        public let name: String
        /// The tags to associate with the image builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.   Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:  _ . : / = + \ - @  If you do not specify a value, the value is set to an empty string.  For more information about tags, see Tagging Your Resources in the Amazon AppStream 2.0 Administration Guide.
        public let tags: [String: String]?
        /// The VPC configuration for the image builder. You can specify only one subnet.
        public let vpcConfig: VpcConfig?

        public init(accessEndpoints: [AccessEndpoint]? = nil, appstreamAgentVersion: String? = nil, description: String? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, iamRoleArn: String? = nil, imageArn: String? = nil, imageName: String? = nil, instanceType: String, name: String, tags: [String: String]? = nil, vpcConfig: VpcConfig? = nil) {
            self.accessEndpoints = accessEndpoints
            self.appstreamAgentVersion = appstreamAgentVersion
            self.description = description
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.iamRoleArn = iamRoleArn
            self.imageArn = imageArn
            self.imageName = imageName
            self.instanceType = instanceType
            self.name = name
            self.tags = tags
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.accessEndpoints?.forEach {
                try $0.validate(name: "\(name).accessEndpoints[]")
            }
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, max: 4)
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, min: 1)
            try self.validate(self.appstreamAgentVersion, name: "appstreamAgentVersion", parent: name, max: 100)
            try self.validate(self.appstreamAgentVersion, name: "appstreamAgentVersion", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.domainJoinInfo?.validate(name: "\(name).domainJoinInfo")
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageArn, name: "imageArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageName, name: "imageName", parent: name, min: 1)
            try self.validate(self.instanceType, name: "instanceType", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case accessEndpoints = "AccessEndpoints"
            case appstreamAgentVersion = "AppstreamAgentVersion"
            case description = "Description"
            case displayName = "DisplayName"
            case domainJoinInfo = "DomainJoinInfo"
            case enableDefaultInternetAccess = "EnableDefaultInternetAccess"
            case iamRoleArn = "IamRoleArn"
            case imageArn = "ImageArn"
            case imageName = "ImageName"
            case instanceType = "InstanceType"
            case name = "Name"
            case tags = "Tags"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct CreateImageBuilderResult: AWSDecodableShape {
        /// Information about the image builder.
        public let imageBuilder: ImageBuilder?

        public init(imageBuilder: ImageBuilder? = nil) {
            self.imageBuilder = imageBuilder
        }

        private enum CodingKeys: String, CodingKey {
            case imageBuilder = "ImageBuilder"
        }
    }

    public struct CreateImageBuilderStreamingURLRequest: AWSEncodableShape {
        /// The name of the image builder.
        public let name: String
        /// The time that the streaming URL will be valid, in seconds.  Specify a value between 1 and 604800 seconds. The default is 3600 seconds.
        public let validity: Int64?

        public init(name: String, validity: Int64? = nil) {
            self.name = name
            self.validity = validity
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case validity = "Validity"
        }
    }

    public struct CreateImageBuilderStreamingURLResult: AWSDecodableShape {
        /// The elapsed time, in seconds after the Unix epoch, when this URL expires.
        public let expires: Date?
        /// The URL to start the AppStream 2.0 streaming session.
        public let streamingURL: String?

        public init(expires: Date? = nil, streamingURL: String? = nil) {
            self.expires = expires
            self.streamingURL = streamingURL
        }

        private enum CodingKeys: String, CodingKey {
            case expires = "Expires"
            case streamingURL = "StreamingURL"
        }
    }

    public struct CreateStackRequest: AWSEncodableShape {
        /// The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.
        public let accessEndpoints: [AccessEndpoint]?
        /// The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.
        public let applicationSettings: ApplicationSettings?
        /// The description to display.
        public let description: String?
        /// The stack name to display.
        public let displayName: String?
        /// The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.
        public let embedHostDomains: [String]?
        /// The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.
        public let feedbackURL: String?
        /// The name of the stack.
        public let name: String
        /// The URL that users are redirected to after their streaming session ends.
        public let redirectURL: String?
        /// The storage connectors to enable.
        public let storageConnectors: [StorageConnector]?
        /// The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.
        public let streamingExperienceSettings: StreamingExperienceSettings?
        /// The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.   If you do not specify a value, the value is set to an empty string.  Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:  _ . : / = + \ - @  For more information about tags, see Tagging Your Resources in the Amazon AppStream 2.0 Administration Guide.
        public let tags: [String: String]?
        /// The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.
        public let userSettings: [UserSetting]?

        public init(accessEndpoints: [AccessEndpoint]? = nil, applicationSettings: ApplicationSettings? = nil, description: String? = nil, displayName: String? = nil, embedHostDomains: [String]? = nil, feedbackURL: String? = nil, name: String, redirectURL: String? = nil, storageConnectors: [StorageConnector]? = nil, streamingExperienceSettings: StreamingExperienceSettings? = nil, tags: [String: String]? = nil, userSettings: [UserSetting]? = nil) {
            self.accessEndpoints = accessEndpoints
            self.applicationSettings = applicationSettings
            self.description = description
            self.displayName = displayName
            self.embedHostDomains = embedHostDomains
            self.feedbackURL = feedbackURL
            self.name = name
            self.redirectURL = redirectURL
            self.storageConnectors = storageConnectors
            self.streamingExperienceSettings = streamingExperienceSettings
            self.tags = tags
            self.userSettings = userSettings
        }

        public func validate(name: String) throws {
            try self.accessEndpoints?.forEach {
                try $0.validate(name: "\(name).accessEndpoints[]")
            }
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, max: 4)
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, min: 1)
            try self.applicationSettings?.validate(name: "\(name).applicationSettings")
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.embedHostDomains?.forEach {
                try validate($0, name: "embedHostDomains[]", parent: name, max: 128)
                try validate($0, name: "embedHostDomains[]", parent: name, pattern: "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$")
            }
            try self.validate(self.embedHostDomains, name: "embedHostDomains", parent: name, max: 20)
            try self.validate(self.embedHostDomains, name: "embedHostDomains", parent: name, min: 1)
            try self.validate(self.feedbackURL, name: "feedbackURL", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.redirectURL, name: "redirectURL", parent: name, max: 1000)
            try self.storageConnectors?.forEach {
                try $0.validate(name: "\(name).storageConnectors[]")
            }
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
            try self.validate(self.userSettings, name: "userSettings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accessEndpoints = "AccessEndpoints"
            case applicationSettings = "ApplicationSettings"
            case description = "Description"
            case displayName = "DisplayName"
            case embedHostDomains = "EmbedHostDomains"
            case feedbackURL = "FeedbackURL"
            case name = "Name"
            case redirectURL = "RedirectURL"
            case storageConnectors = "StorageConnectors"
            case streamingExperienceSettings = "StreamingExperienceSettings"
            case tags = "Tags"
            case userSettings = "UserSettings"
        }
    }

    public struct CreateStackResult: AWSDecodableShape {
        /// Information about the stack.
        public let stack: Stack?

        public init(stack: Stack? = nil) {
            self.stack = stack
        }

        private enum CodingKeys: String, CodingKey {
            case stack = "Stack"
        }
    }

    public struct CreateStreamingURLRequest: AWSEncodableShape {
        /// The name of the application to launch after the session starts. This is the name that you specified as Name in the Image Assistant. If your fleet is enabled for the Desktop stream view, you can also choose to launch directly to the operating system desktop. To do so, specify Desktop.
        public let applicationId: String?
        /// The name of the fleet.
        public let fleetName: String
        /// The session context. For more information, see Session Context in the Amazon AppStream 2.0 Administration Guide.
        public let sessionContext: String?
        /// The name of the stack.
        public let stackName: String
        /// The identifier of the user.
        public let userId: String
        /// The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The default is 60 seconds.
        public let validity: Int64?

        public init(applicationId: String? = nil, fleetName: String, sessionContext: String? = nil, stackName: String, userId: String, validity: Int64? = nil) {
            self.applicationId = applicationId
            self.fleetName = fleetName
            self.sessionContext = sessionContext
            self.stackName = stackName
            self.userId = userId
            self.validity = validity
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.sessionContext, name: "sessionContext", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
            try self.validate(self.userId, name: "userId", parent: name, max: 32)
            try self.validate(self.userId, name: "userId", parent: name, min: 2)
            try self.validate(self.userId, name: "userId", parent: name, pattern: "^[\\w+=,.@-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "ApplicationId"
            case fleetName = "FleetName"
            case sessionContext = "SessionContext"
            case stackName = "StackName"
            case userId = "UserId"
            case validity = "Validity"
        }
    }

    public struct CreateStreamingURLResult: AWSDecodableShape {
        /// The elapsed time, in seconds after the Unix epoch, when this URL expires.
        public let expires: Date?
        /// The URL to start the AppStream 2.0 streaming session.
        public let streamingURL: String?

        public init(expires: Date? = nil, streamingURL: String? = nil) {
            self.expires = expires
            self.streamingURL = streamingURL
        }

        private enum CodingKeys: String, CodingKey {
            case expires = "Expires"
            case streamingURL = "StreamingURL"
        }
    }

    public struct CreateUpdatedImageRequest: AWSEncodableShape {
        /// Indicates whether to display the status of image update availability before AppStream 2.0 initiates the process of creating a new updated image. If this value is set to true, AppStream 2.0 displays whether image updates are available. If this value is set to false, AppStream 2.0 initiates the process of creating a new updated image without displaying whether image updates are available.
        public let dryRun: Bool?
        /// The name of the image to update.
        public let existingImageName: String
        /// The description to display for the new image.
        public let newImageDescription: String?
        /// The name to display for the new image.
        public let newImageDisplayName: String?
        /// The name of the new image. The name must be unique within the AWS account and Region.
        public let newImageName: String
        /// The tags to associate with the new image. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.  Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:  _ . : / = + \ - @ If you do not specify a value, the value is set to an empty string. For more information about tags, see Tagging Your Resources in the Amazon AppStream 2.0 Administration Guide.
        public let newImageTags: [String: String]?

        public init(dryRun: Bool? = nil, existingImageName: String, newImageDescription: String? = nil, newImageDisplayName: String? = nil, newImageName: String, newImageTags: [String: String]? = nil) {
            self.dryRun = dryRun
            self.existingImageName = existingImageName
            self.newImageDescription = newImageDescription
            self.newImageDisplayName = newImageDisplayName
            self.newImageName = newImageName
            self.newImageTags = newImageTags
        }

        public func validate(name: String) throws {
            try self.validate(self.existingImageName, name: "existingImageName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.newImageDescription, name: "newImageDescription", parent: name, max: 256)
            try self.validate(self.newImageDisplayName, name: "newImageDisplayName", parent: name, max: 100)
            try self.validate(self.newImageName, name: "newImageName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.newImageTags?.forEach {
                try validate($0.key, name: "newImageTags.key", parent: name, max: 128)
                try validate($0.key, name: "newImageTags.key", parent: name, min: 1)
                try validate($0.key, name: "newImageTags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "newImageTags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "newImageTags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.newImageTags, name: "newImageTags", parent: name, max: 50)
            try self.validate(self.newImageTags, name: "newImageTags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case dryRun
            case existingImageName
            case newImageDescription
            case newImageDisplayName
            case newImageName
            case newImageTags
        }
    }

    public struct CreateUpdatedImageResult: AWSDecodableShape {
        /// Indicates whether a new image can be created.
        public let canUpdateImage: Bool?
        public let image: Image?

        public init(canUpdateImage: Bool? = nil, image: Image? = nil) {
            self.canUpdateImage = canUpdateImage
            self.image = image
        }

        private enum CodingKeys: String, CodingKey {
            case canUpdateImage
            case image
        }
    }

    public struct CreateUsageReportSubscriptionRequest: AWSEncodableShape {
        public init() {}
    }

    public struct CreateUsageReportSubscriptionResult: AWSDecodableShape {
        /// The Amazon S3 bucket where generated reports are stored.   If you enabled on-instance session scripts and Amazon S3 logging for your session script configuration, AppStream 2.0 created an S3 bucket to store the script output. The bucket is unique to your account and Region. When you enable usage reporting in this case, AppStream 2.0 uses the same bucket to store your usage reports. If you haven't already enabled on-instance session scripts,  when you enable usage reports, AppStream 2.0 creates a new S3 bucket.
        public let s3BucketName: String?
        /// The schedule for generating usage reports.
        public let schedule: UsageReportSchedule?

        public init(s3BucketName: String? = nil, schedule: UsageReportSchedule? = nil) {
            self.s3BucketName = s3BucketName
            self.schedule = schedule
        }

        private enum CodingKeys: String, CodingKey {
            case s3BucketName = "S3BucketName"
            case schedule = "Schedule"
        }
    }

    public struct CreateUserRequest: AWSEncodableShape {
        /// The authentication type for the user. You must specify USERPOOL.
        public let authenticationType: AuthenticationType
        /// The first name, or given name, of the user.
        public let firstName: String?
        /// The last name, or surname, of the user.
        public let lastName: String?
        /// The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.    The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.
        public let messageAction: MessageAction?
        /// The email address of the user.   Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.
        public let userName: String

        public init(authenticationType: AuthenticationType, firstName: String? = nil, lastName: String? = nil, messageAction: MessageAction? = nil, userName: String) {
            self.authenticationType = authenticationType
            self.firstName = firstName
            self.lastName = lastName
            self.messageAction = messageAction
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.firstName, name: "firstName", parent: name, max: 2048)
            try self.validate(self.firstName, name: "firstName", parent: name, pattern: "^[A-Za-z0-9_\\-\\s]+$")
            try self.validate(self.lastName, name: "lastName", parent: name, max: 2048)
            try self.validate(self.lastName, name: "lastName", parent: name, pattern: "^[A-Za-z0-9_\\-\\s]+$")
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case firstName = "FirstName"
            case lastName = "LastName"
            case messageAction = "MessageAction"
            case userName = "UserName"
        }
    }

    public struct CreateUserResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteAppBlockRequest: AWSEncodableShape {
        /// The name of the app block.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteAppBlockResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteApplicationRequest: AWSEncodableShape {
        /// The name of the application.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteApplicationResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteDirectoryConfigRequest: AWSEncodableShape {
        /// The name of the directory configuration.
        public let directoryName: String

        public init(directoryName: String) {
            self.directoryName = directoryName
        }

        private enum CodingKeys: String, CodingKey {
            case directoryName = "DirectoryName"
        }
    }

    public struct DeleteDirectoryConfigResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteEntitlementRequest: AWSEncodableShape {
        /// The name of the entitlement.
        public let name: String
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(name: String, stackName: String) {
            self.name = name
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case stackName = "StackName"
        }
    }

    public struct DeleteEntitlementResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteFleetRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteImageBuilderRequest: AWSEncodableShape {
        /// The name of the image builder.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteImageBuilderResult: AWSDecodableShape {
        /// Information about the image builder.
        public let imageBuilder: ImageBuilder?

        public init(imageBuilder: ImageBuilder? = nil) {
            self.imageBuilder = imageBuilder
        }

        private enum CodingKeys: String, CodingKey {
            case imageBuilder = "ImageBuilder"
        }
    }

    public struct DeleteImagePermissionsRequest: AWSEncodableShape {
        /// The name of the private image.
        public let name: String
        /// The 12-digit identifier of the AWS account for which to delete image permissions.
        public let sharedAccountId: String

        public init(name: String, sharedAccountId: String) {
            self.name = name
            self.sharedAccountId = sharedAccountId
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.sharedAccountId, name: "sharedAccountId", parent: name, pattern: "^\\d+$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case sharedAccountId = "SharedAccountId"
        }
    }

    public struct DeleteImagePermissionsResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteImageRequest: AWSEncodableShape {
        /// The name of the image.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteImageResult: AWSDecodableShape {
        /// Information about the image.
        public let image: Image?

        public init(image: Image? = nil) {
            self.image = image
        }

        private enum CodingKeys: String, CodingKey {
            case image = "Image"
        }
    }

    public struct DeleteStackRequest: AWSEncodableShape {
        /// The name of the stack.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct DeleteStackResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteUsageReportSubscriptionRequest: AWSEncodableShape {
        public init() {}
    }

    public struct DeleteUsageReportSubscriptionResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteUserRequest: AWSEncodableShape {
        /// The authentication type for the user. You must specify USERPOOL.
        public let authenticationType: AuthenticationType
        /// The email address of the user.   Users' email addresses are case-sensitive.
        public let userName: String

        public init(authenticationType: AuthenticationType, userName: String) {
            self.authenticationType = authenticationType
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case userName = "UserName"
        }
    }

    public struct DeleteUserResult: AWSDecodableShape {
        public init() {}
    }

    public struct DescribeAppBlocksRequest: AWSEncodableShape {
        /// The ARNs of the app blocks.
        public let arns: [String]?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(arns: [String]? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.arns = arns
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeAppBlocksResult: AWSDecodableShape {
        /// The app blocks in the list.
        public let appBlocks: [AppBlock]?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(appBlocks: [AppBlock]? = nil, nextToken: String? = nil) {
            self.appBlocks = appBlocks
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case appBlocks = "AppBlocks"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeApplicationFleetAssociationsRequest: AWSEncodableShape {
        /// The ARN of the application.
        public let applicationArn: String?
        /// The name of the fleet.
        public let fleetName: String?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(applicationArn: String? = nil, fleetName: String? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.applicationArn = applicationArn
            self.fleetName = fleetName
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationArn, name: "applicationArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.fleetName, name: "fleetName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "ApplicationArn"
            case fleetName = "FleetName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeApplicationFleetAssociationsResult: AWSDecodableShape {
        /// The application fleet associations in the list.
        public let applicationFleetAssociations: [ApplicationFleetAssociation]?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(applicationFleetAssociations: [ApplicationFleetAssociation]? = nil, nextToken: String? = nil) {
            self.applicationFleetAssociations = applicationFleetAssociations
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case applicationFleetAssociations = "ApplicationFleetAssociations"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeApplicationsRequest: AWSEncodableShape {
        /// The ARNs for the applications.
        public let arns: [String]?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(arns: [String]? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.arns = arns
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeApplicationsResult: AWSDecodableShape {
        /// The applications in the list.
        public let applications: [Application]?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(applications: [Application]? = nil, nextToken: String? = nil) {
            self.applications = applications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case applications = "Applications"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeDirectoryConfigsRequest: AWSEncodableShape {
        /// The directory names.
        public let directoryNames: [String]?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(directoryNames: [String]? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.directoryNames = directoryNames
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryNames = "DirectoryNames"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeDirectoryConfigsResult: AWSDecodableShape {
        /// Information about the directory configurations. Note that although the response syntax in this topic includes the account password, this password is not returned in the actual response.
        public let directoryConfigs: [DirectoryConfig]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(directoryConfigs: [DirectoryConfig]? = nil, nextToken: String? = nil) {
            self.directoryConfigs = directoryConfigs
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case directoryConfigs = "DirectoryConfigs"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeEntitlementsRequest: AWSEncodableShape {
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The name of the entitlement.
        public let name: String?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(maxResults: Int? = nil, name: String? = nil, nextToken: String? = nil, stackName: String) {
            self.maxResults = maxResults
            self.name = name
            self.nextToken = nextToken
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case name = "Name"
            case nextToken = "NextToken"
            case stackName = "StackName"
        }
    }

    public struct DescribeEntitlementsResult: AWSDecodableShape {
        /// The entitlements.
        public let entitlements: [Entitlement]?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(entitlements: [Entitlement]? = nil, nextToken: String? = nil) {
            self.entitlements = entitlements
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case entitlements = "Entitlements"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeFleetsRequest: AWSEncodableShape {
        /// The names of the fleets to describe.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(names: [String]? = nil, nextToken: String? = nil) {
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, min: 1)
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeFleetsResult: AWSDecodableShape {
        /// Information about the fleets.
        public let fleets: [Fleet]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(fleets: [Fleet]? = nil, nextToken: String? = nil) {
            self.fleets = fleets
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case fleets = "Fleets"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeImageBuildersRequest: AWSEncodableShape {
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The names of the image builders to describe.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, min: 1)
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeImageBuildersResult: AWSDecodableShape {
        /// Information about the image builders.
        public let imageBuilders: [ImageBuilder]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(imageBuilders: [ImageBuilder]? = nil, nextToken: String? = nil) {
            self.imageBuilders = imageBuilders
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case imageBuilders = "ImageBuilders"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeImagePermissionsRequest: AWSEncodableShape {
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The name of the private image for which to describe permissions. The image must be one that you own.
        public let name: String
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The 12-digit identifier of one or more AWS accounts with which the image is shared.
        public let sharedAwsAccountIds: [String]?

        public init(maxResults: Int? = nil, name: String, nextToken: String? = nil, sharedAwsAccountIds: [String]? = nil) {
            self.maxResults = maxResults
            self.name = name
            self.nextToken = nextToken
            self.sharedAwsAccountIds = sharedAwsAccountIds
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.sharedAwsAccountIds?.forEach {
                try validate($0, name: "sharedAwsAccountIds[]", parent: name, pattern: "^\\d+$")
            }
            try self.validate(self.sharedAwsAccountIds, name: "sharedAwsAccountIds", parent: name, max: 5)
            try self.validate(self.sharedAwsAccountIds, name: "sharedAwsAccountIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case name = "Name"
            case nextToken = "NextToken"
            case sharedAwsAccountIds = "SharedAwsAccountIds"
        }
    }

    public struct DescribeImagePermissionsResult: AWSDecodableShape {
        /// The name of the private image.
        public let name: String?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// The permissions for a private image that you own.
        public let sharedImagePermissionsList: [SharedImagePermissions]?

        public init(name: String? = nil, nextToken: String? = nil, sharedImagePermissionsList: [SharedImagePermissions]? = nil) {
            self.name = name
            self.nextToken = nextToken
            self.sharedImagePermissionsList = sharedImagePermissionsList
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case nextToken = "NextToken"
            case sharedImagePermissionsList = "SharedImagePermissionsList"
        }
    }

    public struct DescribeImagesRequest: AWSEncodableShape {
        /// The ARNs of the public, private, and shared images to describe.
        public let arns: [String]?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The names of the public or private images to describe.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The type of image (public, private, or shared) to describe.
        public let type: VisibilityType?

        public init(arns: [String]? = nil, maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil, type: VisibilityType? = nil) {
            self.arns = arns
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
            self.type = type
        }

        public func validate(name: String) throws {
            try self.arns?.forEach {
                try validate($0, name: "arns[]", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            }
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 25)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, min: 1)
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case arns = "Arns"
            case maxResults = "MaxResults"
            case names = "Names"
            case nextToken = "NextToken"
            case type = "Type"
        }
    }

    public struct DescribeImagesResult: AWSDecodableShape {
        /// Information about the images.
        public let images: [Image]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(images: [Image]? = nil, nextToken: String? = nil) {
            self.images = images
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case images = "Images"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeSessionsRequest: AWSEncodableShape {
        /// The authentication method. Specify API for a user authenticated using a streaming URL or SAML for a SAML federated user.  The default is to authenticate users using a streaming URL.
        public let authenticationType: AuthenticationType?
        /// The name of the fleet. This value is case-sensitive.
        public let fleetName: String
        /// The size of each page of results. The default value is 20 and the maximum value is 50.
        public let limit: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The name of the stack. This value is case-sensitive.
        public let stackName: String
        /// The user identifier (ID). If you specify a user ID, you must also specify the authentication type.
        public let userId: String?

        public init(authenticationType: AuthenticationType? = nil, fleetName: String, limit: Int? = nil, nextToken: String? = nil, stackName: String, userId: String? = nil) {
            self.authenticationType = authenticationType
            self.fleetName = fleetName
            self.limit = limit
            self.nextToken = nextToken
            self.stackName = stackName
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
            try self.validate(self.userId, name: "userId", parent: name, max: 128)
            try self.validate(self.userId, name: "userId", parent: name, min: 2)
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case fleetName = "FleetName"
            case limit = "Limit"
            case nextToken = "NextToken"
            case stackName = "StackName"
            case userId = "UserId"
        }
    }

    public struct DescribeSessionsResult: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// Information about the streaming sessions.
        public let sessions: [Session]?

        public init(nextToken: String? = nil, sessions: [Session]? = nil) {
            self.nextToken = nextToken
            self.sessions = sessions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case sessions = "Sessions"
        }
    }

    public struct DescribeStacksRequest: AWSEncodableShape {
        /// The names of the stacks to describe.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(names: [String]? = nil, nextToken: String? = nil) {
            self.names = names
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, min: 1)
            }
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeStacksResult: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// Information about the stacks.
        public let stacks: [Stack]?

        public init(nextToken: String? = nil, stacks: [Stack]? = nil) {
            self.nextToken = nextToken
            self.stacks = stacks
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case stacks = "Stacks"
        }
    }

    public struct DescribeUsageReportSubscriptionsRequest: AWSEncodableShape {
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeUsageReportSubscriptionsResult: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// Information about the usage report subscription.
        public let usageReportSubscriptions: [UsageReportSubscription]?

        public init(nextToken: String? = nil, usageReportSubscriptions: [UsageReportSubscription]? = nil) {
            self.nextToken = nextToken
            self.usageReportSubscriptions = usageReportSubscriptions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case usageReportSubscriptions = "UsageReportSubscriptions"
        }
    }

    public struct DescribeUserStackAssociationsRequest: AWSEncodableShape {
        /// The authentication type for the user who is associated with the stack. You must specify USERPOOL.
        public let authenticationType: AuthenticationType?
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The name of the stack that is associated with the user.
        public let stackName: String?
        /// The email address of the user who is associated with the stack.   Users' email addresses are case-sensitive.
        public let userName: String?

        public init(authenticationType: AuthenticationType? = nil, maxResults: Int? = nil, nextToken: String? = nil, stackName: String? = nil, userName: String? = nil) {
            self.authenticationType = authenticationType
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.stackName = stackName
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 500)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case stackName = "StackName"
            case userName = "UserName"
        }
    }

    public struct DescribeUserStackAssociationsResult: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// The UserStackAssociation objects.
        public let userStackAssociations: [UserStackAssociation]?

        public init(nextToken: String? = nil, userStackAssociations: [UserStackAssociation]? = nil) {
            self.nextToken = nextToken
            self.userStackAssociations = userStackAssociations
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case userStackAssociations = "UserStackAssociations"
        }
    }

    public struct DescribeUsersRequest: AWSEncodableShape {
        /// The authentication type for the users in the user pool to describe. You must specify USERPOOL.
        public let authenticationType: AuthenticationType
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(authenticationType: AuthenticationType, maxResults: Int? = nil, nextToken: String? = nil) {
            self.authenticationType = authenticationType
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct DescribeUsersResult: AWSDecodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?
        /// Information about users in the user pool.
        public let users: [User]?

        public init(nextToken: String? = nil, users: [User]? = nil) {
            self.nextToken = nextToken
            self.users = users
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case users = "Users"
        }
    }

    public struct DirectoryConfig: AWSDecodableShape {
        /// The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is Enabled . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. Enabled_no_directory_login_fallback enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.
        public let certificateBasedAuthProperties: CertificateBasedAuthProperties?
        /// The time the directory configuration was created.
        public let createdTime: Date?
        /// The fully qualified name of the directory (for example, corp.example.com).
        public let directoryName: String
        /// The distinguished names of the organizational units for computer accounts.
        public let organizationalUnitDistinguishedNames: [String]?
        /// The credentials for the service account used by the fleet or image builder to connect to the directory.
        public let serviceAccountCredentials: ServiceAccountCredentials?

        public init(certificateBasedAuthProperties: CertificateBasedAuthProperties? = nil, createdTime: Date? = nil, directoryName: String, organizationalUnitDistinguishedNames: [String]? = nil, serviceAccountCredentials: ServiceAccountCredentials? = nil) {
            self.certificateBasedAuthProperties = certificateBasedAuthProperties
            self.createdTime = createdTime
            self.directoryName = directoryName
            self.organizationalUnitDistinguishedNames = organizationalUnitDistinguishedNames
            self.serviceAccountCredentials = serviceAccountCredentials
        }

        private enum CodingKeys: String, CodingKey {
            case certificateBasedAuthProperties = "CertificateBasedAuthProperties"
            case createdTime = "CreatedTime"
            case directoryName = "DirectoryName"
            case organizationalUnitDistinguishedNames = "OrganizationalUnitDistinguishedNames"
            case serviceAccountCredentials = "ServiceAccountCredentials"
        }
    }

    public struct DisableUserRequest: AWSEncodableShape {
        /// The authentication type for the user. You must specify USERPOOL.
        public let authenticationType: AuthenticationType
        /// The email address of the user.   Users' email addresses are case-sensitive.
        public let userName: String

        public init(authenticationType: AuthenticationType, userName: String) {
            self.authenticationType = authenticationType
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case userName = "UserName"
        }
    }

    public struct DisableUserResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateApplicationFleetRequest: AWSEncodableShape {
        /// The ARN of the application.
        public let applicationArn: String
        /// The name of the fleet.
        public let fleetName: String

        public init(applicationArn: String, fleetName: String) {
            self.applicationArn = applicationArn
            self.fleetName = fleetName
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationArn, name: "applicationArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.fleetName, name: "fleetName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "ApplicationArn"
            case fleetName = "FleetName"
        }
    }

    public struct DisassociateApplicationFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateApplicationFromEntitlementRequest: AWSEncodableShape {
        /// The identifier of the application to remove from the entitlement.
        public let applicationIdentifier: String
        /// The name of the entitlement.
        public let entitlementName: String
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(applicationIdentifier: String, entitlementName: String, stackName: String) {
            self.applicationIdentifier = applicationIdentifier
            self.entitlementName = entitlementName
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationIdentifier, name: "applicationIdentifier", parent: name, min: 1)
            try self.validate(self.entitlementName, name: "entitlementName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationIdentifier = "ApplicationIdentifier"
            case entitlementName = "EntitlementName"
            case stackName = "StackName"
        }
    }

    public struct DisassociateApplicationFromEntitlementResult: AWSDecodableShape {
        public init() {}
    }

    public struct DisassociateFleetRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let fleetName: String
        /// The name of the stack.
        public let stackName: String

        public init(fleetName: String, stackName: String) {
            self.fleetName = fleetName
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetName = "FleetName"
            case stackName = "StackName"
        }
    }

    public struct DisassociateFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct DomainJoinInfo: AWSEncodableShape & AWSDecodableShape {
        /// The fully qualified name of the directory (for example, corp.example.com).
        public let directoryName: String?
        /// The distinguished name of the organizational unit for computer accounts.
        public let organizationalUnitDistinguishedName: String?

        public init(directoryName: String? = nil, organizationalUnitDistinguishedName: String? = nil) {
            self.directoryName = directoryName
            self.organizationalUnitDistinguishedName = organizationalUnitDistinguishedName
        }

        public func validate(name: String) throws {
            try self.validate(self.organizationalUnitDistinguishedName, name: "organizationalUnitDistinguishedName", parent: name, max: 2000)
        }

        private enum CodingKeys: String, CodingKey {
            case directoryName = "DirectoryName"
            case organizationalUnitDistinguishedName = "OrganizationalUnitDistinguishedName"
        }
    }

    public struct EnableUserRequest: AWSEncodableShape {
        /// The authentication type for the user. You must specify USERPOOL.
        public let authenticationType: AuthenticationType
        /// The email address of the user.   Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.
        public let userName: String

        public init(authenticationType: AuthenticationType, userName: String) {
            self.authenticationType = authenticationType
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case userName = "UserName"
        }
    }

    public struct EnableUserResult: AWSDecodableShape {
        public init() {}
    }

    public struct EntitledApplication: AWSDecodableShape {
        /// The identifier of the application.
        public let applicationIdentifier: String

        public init(applicationIdentifier: String) {
            self.applicationIdentifier = applicationIdentifier
        }

        private enum CodingKeys: String, CodingKey {
            case applicationIdentifier = "ApplicationIdentifier"
        }
    }

    public struct Entitlement: AWSDecodableShape {
        /// Specifies whether all or selected apps are entitled.
        public let appVisibility: AppVisibility
        /// The attributes of the entitlement.
        public let attributes: [EntitlementAttribute]
        /// The time when the entitlement was created.
        public let createdTime: Date?
        /// The description of the entitlement.
        public let description: String?
        /// The time when the entitlement was last modified.
        public let lastModifiedTime: Date?
        /// The name of the entitlement.
        public let name: String
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(appVisibility: AppVisibility, attributes: [EntitlementAttribute], createdTime: Date? = nil, description: String? = nil, lastModifiedTime: Date? = nil, name: String, stackName: String) {
            self.appVisibility = appVisibility
            self.attributes = attributes
            self.createdTime = createdTime
            self.description = description
            self.lastModifiedTime = lastModifiedTime
            self.name = name
            self.stackName = stackName
        }

        private enum CodingKeys: String, CodingKey {
            case appVisibility = "AppVisibility"
            case attributes = "Attributes"
            case createdTime = "CreatedTime"
            case description = "Description"
            case lastModifiedTime = "LastModifiedTime"
            case name = "Name"
            case stackName = "StackName"
        }
    }

    public struct EntitlementAttribute: AWSEncodableShape & AWSDecodableShape {
        /// A supported AWS IAM SAML PrincipalTag attribute that is matched to the associated value when a user identity federates into an Amazon AppStream 2.0 SAML application. The following are valid values:   roles   department    organization    groups    title    costCenter    userType
        public let name: String
        /// A value that is matched to a supported SAML attribute name when a user identity federates into an Amazon AppStream 2.0 SAML application.
        public let value: String

        public init(name: String, value: String) {
            self.name = name
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
            case value = "Value"
        }
    }

    public struct ExpireSessionRequest: AWSEncodableShape {
        /// The identifier of the streaming session.
        public let sessionId: String

        public init(sessionId: String) {
            self.sessionId = sessionId
        }

        public func validate(name: String) throws {
            try self.validate(self.sessionId, name: "sessionId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case sessionId = "SessionId"
        }
    }

    public struct ExpireSessionResult: AWSDecodableShape {
        public init() {}
    }

    public struct Fleet: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for the fleet.
        public let arn: String
        /// The capacity status for the fleet.
        public let computeCapacityStatus: ComputeCapacityStatus
        /// The time the fleet was created.
        public let createdTime: Date?
        /// The description to display.
        public let description: String?
        /// The amount of time that a streaming session remains active after users disconnect. If they try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance. Specify a value between 60 and 360000.
        public let disconnectTimeoutInSeconds: Int?
        /// The fleet name to display.
        public let displayName: String?
        /// The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain.
        public let domainJoinInfo: DomainJoinInfo?
        /// Indicates whether default internet access is enabled for the fleet.
        public let enableDefaultInternetAccess: Bool?
        /// The fleet errors.
        public let fleetErrors: [FleetError]?
        /// The fleet type.  ALWAYS_ON  Provides users with instant-on access to their apps. You are charged for all running instances in your fleet, even if no users are streaming apps.  ON_DEMAND  Provide users with access to applications after they connect, which takes one to two minutes. You are charged for instance streaming when users are connected and a small hourly fee for instances that are not streaming apps.
        public let fleetType: FleetType?
        /// The ARN of the IAM role that is applied to the fleet. To assume a role, the fleet instance calls the AWS Security Token Service (STS) AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.  For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide.
        public let iamRoleArn: String?
        /// The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the DisconnectTimeoutInSeconds time interval begins. Users are notified before they are disconnected due to inactivity. If users try to reconnect to the streaming session before the time interval specified in DisconnectTimeoutInSeconds elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in IdleDisconnectTimeoutInSeconds elapses, they are disconnected. To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.   If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don't do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity.
        public let idleDisconnectTimeoutInSeconds: Int?
        /// The ARN for the public, private, or shared image.
        public let imageArn: String?
        /// The name of the image used to create the fleet.
        public let imageName: String?
        /// The instance type to use when launching fleet instances. The following instance types are available:       stream.standard.small   stream.standard.medium   stream.standard.large   stream.compute.large   stream.compute.xlarge   stream.compute.2xlarge   stream.compute.4xlarge   stream.compute.8xlarge   stream.memory.large   stream.memory.xlarge   stream.memory.2xlarge   stream.memory.4xlarge   stream.memory.8xlarge   stream.memory.z1d.large   stream.memory.z1d.xlarge   stream.memory.z1d.2xlarge   stream.memory.z1d.3xlarge   stream.memory.z1d.6xlarge   stream.memory.z1d.12xlarge   stream.graphics-design.large   stream.graphics-design.xlarge   stream.graphics-design.2xlarge   stream.graphics-design.4xlarge   stream.graphics-desktop.2xlarge   stream.graphics.g4dn.xlarge   stream.graphics.g4dn.2xlarge   stream.graphics.g4dn.4xlarge   stream.graphics.g4dn.8xlarge   stream.graphics.g4dn.12xlarge   stream.graphics.g4dn.16xlarge   stream.graphics-pro.4xlarge   stream.graphics-pro.8xlarge   stream.graphics-pro.16xlarge
        public let instanceType: String
        /// The maximum number of concurrent sessions for the fleet.
        public let maxConcurrentSessions: Int?
        /// The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance.  Specify a value between 600 and 360000.
        public let maxUserDurationInSeconds: Int?
        /// The name of the fleet.
        public let name: String
        /// The platform of the fleet.
        public let platform: PlatformType?
        /// The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets.
        public let sessionScriptS3Location: S3Location?
        /// The current state for the fleet.
        public let state: FleetState
        /// The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When APP is specified, only the windows of applications opened by users display. When DESKTOP is specified, the standard desktop that is provided by the operating system displays.  The default value is APP.
        public let streamView: StreamView?
        /// The USB device filter strings associated with the fleet.
        public let usbDeviceFilterStrings: [String]?
        /// The VPC configuration for the fleet.
        public let vpcConfig: VpcConfig?

        public init(arn: String, computeCapacityStatus: ComputeCapacityStatus, createdTime: Date? = nil, description: String? = nil, disconnectTimeoutInSeconds: Int? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, fleetErrors: [FleetError]? = nil, fleetType: FleetType? = nil, iamRoleArn: String? = nil, idleDisconnectTimeoutInSeconds: Int? = nil, imageArn: String? = nil, imageName: String? = nil, instanceType: String, maxConcurrentSessions: Int? = nil, maxUserDurationInSeconds: Int? = nil, name: String, platform: PlatformType? = nil, sessionScriptS3Location: S3Location? = nil, state: FleetState, streamView: StreamView? = nil, usbDeviceFilterStrings: [String]? = nil, vpcConfig: VpcConfig? = nil) {
            self.arn = arn
            self.computeCapacityStatus = computeCapacityStatus
            self.createdTime = createdTime
            self.description = description
            self.disconnectTimeoutInSeconds = disconnectTimeoutInSeconds
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.fleetErrors = fleetErrors
            self.fleetType = fleetType
            self.iamRoleArn = iamRoleArn
            self.idleDisconnectTimeoutInSeconds = idleDisconnectTimeoutInSeconds
            self.imageArn = imageArn
            self.imageName = imageName
            self.instanceType = instanceType
            self.maxConcurrentSessions = maxConcurrentSessions
            self.maxUserDurationInSeconds = maxUserDurationInSeconds
            self.name = name
            self.platform = platform
            self.sessionScriptS3Location = sessionScriptS3Location
            self.state = state
            self.streamView = streamView
            self.usbDeviceFilterStrings = usbDeviceFilterStrings
            self.vpcConfig = vpcConfig
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case computeCapacityStatus = "ComputeCapacityStatus"
            case createdTime = "CreatedTime"
            case description = "Description"
            case disconnectTimeoutInSeconds = "DisconnectTimeoutInSeconds"
            case displayName = "DisplayName"
            case domainJoinInfo = "DomainJoinInfo"
            case enableDefaultInternetAccess = "EnableDefaultInternetAccess"
            case fleetErrors = "FleetErrors"
            case fleetType = "FleetType"
            case iamRoleArn = "IamRoleArn"
            case idleDisconnectTimeoutInSeconds = "IdleDisconnectTimeoutInSeconds"
            case imageArn = "ImageArn"
            case imageName = "ImageName"
            case instanceType = "InstanceType"
            case maxConcurrentSessions = "MaxConcurrentSessions"
            case maxUserDurationInSeconds = "MaxUserDurationInSeconds"
            case name = "Name"
            case platform = "Platform"
            case sessionScriptS3Location = "SessionScriptS3Location"
            case state = "State"
            case streamView = "StreamView"
            case usbDeviceFilterStrings = "UsbDeviceFilterStrings"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct FleetError: AWSDecodableShape {
        /// The error code.
        public let errorCode: FleetErrorCode?
        /// The error message.
        public let errorMessage: String?

        public init(errorCode: FleetErrorCode? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct Image: AWSDecodableShape {
        /// The applications associated with the image.
        public let applications: [Application]?
        /// The version of the AppStream 2.0 agent to use for instances that are launched from this image.
        public let appstreamAgentVersion: String?
        /// The ARN of the image.
        public let arn: String?
        /// The ARN of the image from which this image was created.
        public let baseImageArn: String?
        /// The time the image was created.
        public let createdTime: Date?
        /// The description to display.
        public let description: String?
        /// The image name to display.
        public let displayName: String?
        /// The name of the image builder that was used to create the private image. If the image is shared, this value is null.
        public let imageBuilderName: String?
        /// Indicates whether an image builder can be launched from this image.
        public let imageBuilderSupported: Bool?
        /// Describes the errors that are returned when a new image can't be created.
        public let imageErrors: [ResourceError]?
        /// The permissions to provide to the destination AWS account for the specified image.
        public let imagePermissions: ImagePermissions?
        /// The name of the image.
        public let name: String
        /// The operating system platform of the image.
        public let platform: PlatformType?
        /// The release date of the public base image.  For private images, this date is the release date of the base image from which the image was created.
        public let publicBaseImageReleasedDate: Date?
        /// The image starts in the PENDING state. If image creation succeeds, the state is AVAILABLE. If image creation fails, the state is FAILED.
        public let state: ImageState?
        /// The reason why the last state change occurred.
        public let stateChangeReason: ImageStateChangeReason?
        /// Indicates whether the image is public or private.
        public let visibility: VisibilityType?

        public init(applications: [Application]? = nil, appstreamAgentVersion: String? = nil, arn: String? = nil, baseImageArn: String? = nil, createdTime: Date? = nil, description: String? = nil, displayName: String? = nil, imageBuilderName: String? = nil, imageBuilderSupported: Bool? = nil, imageErrors: [ResourceError]? = nil, imagePermissions: ImagePermissions? = nil, name: String, platform: PlatformType? = nil, publicBaseImageReleasedDate: Date? = nil, state: ImageState? = nil, stateChangeReason: ImageStateChangeReason? = nil, visibility: VisibilityType? = nil) {
            self.applications = applications
            self.appstreamAgentVersion = appstreamAgentVersion
            self.arn = arn
            self.baseImageArn = baseImageArn
            self.createdTime = createdTime
            self.description = description
            self.displayName = displayName
            self.imageBuilderName = imageBuilderName
            self.imageBuilderSupported = imageBuilderSupported
            self.imageErrors = imageErrors
            self.imagePermissions = imagePermissions
            self.name = name
            self.platform = platform
            self.publicBaseImageReleasedDate = publicBaseImageReleasedDate
            self.state = state
            self.stateChangeReason = stateChangeReason
            self.visibility = visibility
        }

        private enum CodingKeys: String, CodingKey {
            case applications = "Applications"
            case appstreamAgentVersion = "AppstreamAgentVersion"
            case arn = "Arn"
            case baseImageArn = "BaseImageArn"
            case createdTime = "CreatedTime"
            case description = "Description"
            case displayName = "DisplayName"
            case imageBuilderName = "ImageBuilderName"
            case imageBuilderSupported = "ImageBuilderSupported"
            case imageErrors = "ImageErrors"
            case imagePermissions = "ImagePermissions"
            case name = "Name"
            case platform = "Platform"
            case publicBaseImageReleasedDate = "PublicBaseImageReleasedDate"
            case state = "State"
            case stateChangeReason = "StateChangeReason"
            case visibility = "Visibility"
        }
    }

    public struct ImageBuilder: AWSDecodableShape {
        /// The list of virtual private cloud (VPC) interface endpoint objects. Administrators can connect to the image builder only through the specified endpoints.
        public let accessEndpoints: [AccessEndpoint]?
        /// The version of the AppStream 2.0 agent that is currently being used by the image builder.
        public let appstreamAgentVersion: String?
        /// The ARN for the image builder.
        public let arn: String?
        /// The time stamp when the image builder was created.
        public let createdTime: Date?
        /// The description to display.
        public let description: String?
        /// The image builder name to display.
        public let displayName: String?
        /// The name of the directory and organizational unit (OU) to use to join the image builder to a Microsoft Active Directory domain.
        public let domainJoinInfo: DomainJoinInfo?
        /// Enables or disables default internet access for the image builder.
        public let enableDefaultInternetAccess: Bool?
        /// The ARN of the IAM role that is applied to the image builder. To assume a role, the image builder calls the AWS Security Token Service (STS) AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.  For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide.
        public let iamRoleArn: String?
        /// The ARN of the image from which this builder was created.
        public let imageArn: String?
        /// The image builder errors.
        public let imageBuilderErrors: [ResourceError]?
        /// The instance type for the image builder. The following instance types are available:      stream.standard.small   stream.standard.medium   stream.standard.large   stream.compute.large   stream.compute.xlarge   stream.compute.2xlarge   stream.compute.4xlarge   stream.compute.8xlarge   stream.memory.large   stream.memory.xlarge   stream.memory.2xlarge   stream.memory.4xlarge   stream.memory.8xlarge   stream.memory.z1d.large   stream.memory.z1d.xlarge   stream.memory.z1d.2xlarge   stream.memory.z1d.3xlarge   stream.memory.z1d.6xlarge   stream.memory.z1d.12xlarge   stream.graphics-design.large   stream.graphics-design.xlarge   stream.graphics-design.2xlarge   stream.graphics-design.4xlarge   stream.graphics-desktop.2xlarge   stream.graphics.g4dn.xlarge   stream.graphics.g4dn.2xlarge   stream.graphics.g4dn.4xlarge   stream.graphics.g4dn.8xlarge   stream.graphics.g4dn.12xlarge   stream.graphics.g4dn.16xlarge   stream.graphics-pro.4xlarge   stream.graphics-pro.8xlarge   stream.graphics-pro.16xlarge
        public let instanceType: String?
        /// The name of the image builder.
        public let name: String
        public let networkAccessConfiguration: NetworkAccessConfiguration?
        /// The operating system platform of the image builder.
        public let platform: PlatformType?
        /// The state of the image builder.
        public let state: ImageBuilderState?
        /// The reason why the last state change occurred.
        public let stateChangeReason: ImageBuilderStateChangeReason?
        /// The VPC configuration of the image builder.
        public let vpcConfig: VpcConfig?

        public init(accessEndpoints: [AccessEndpoint]? = nil, appstreamAgentVersion: String? = nil, arn: String? = nil, createdTime: Date? = nil, description: String? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, iamRoleArn: String? = nil, imageArn: String? = nil, imageBuilderErrors: [ResourceError]? = nil, instanceType: String? = nil, name: String, networkAccessConfiguration: NetworkAccessConfiguration? = nil, platform: PlatformType? = nil, state: ImageBuilderState? = nil, stateChangeReason: ImageBuilderStateChangeReason? = nil, vpcConfig: VpcConfig? = nil) {
            self.accessEndpoints = accessEndpoints
            self.appstreamAgentVersion = appstreamAgentVersion
            self.arn = arn
            self.createdTime = createdTime
            self.description = description
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.iamRoleArn = iamRoleArn
            self.imageArn = imageArn
            self.imageBuilderErrors = imageBuilderErrors
            self.instanceType = instanceType
            self.name = name
            self.networkAccessConfiguration = networkAccessConfiguration
            self.platform = platform
            self.state = state
            self.stateChangeReason = stateChangeReason
            self.vpcConfig = vpcConfig
        }

        private enum CodingKeys: String, CodingKey {
            case accessEndpoints = "AccessEndpoints"
            case appstreamAgentVersion = "AppstreamAgentVersion"
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case description = "Description"
            case displayName = "DisplayName"
            case domainJoinInfo = "DomainJoinInfo"
            case enableDefaultInternetAccess = "EnableDefaultInternetAccess"
            case iamRoleArn = "IamRoleArn"
            case imageArn = "ImageArn"
            case imageBuilderErrors = "ImageBuilderErrors"
            case instanceType = "InstanceType"
            case name = "Name"
            case networkAccessConfiguration = "NetworkAccessConfiguration"
            case platform = "Platform"
            case state = "State"
            case stateChangeReason = "StateChangeReason"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct ImageBuilderStateChangeReason: AWSDecodableShape {
        /// The state change reason code.
        public let code: ImageBuilderStateChangeReasonCode?
        /// The state change reason message.
        public let message: String?

        public init(code: ImageBuilderStateChangeReasonCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct ImagePermissions: AWSEncodableShape & AWSDecodableShape {
        /// Indicates whether the image can be used for a fleet.
        public let allowFleet: Bool?
        /// Indicates whether the image can be used for an image builder.
        public let allowImageBuilder: Bool?

        public init(allowFleet: Bool? = nil, allowImageBuilder: Bool? = nil) {
            self.allowFleet = allowFleet
            self.allowImageBuilder = allowImageBuilder
        }

        private enum CodingKeys: String, CodingKey {
            case allowFleet
            case allowImageBuilder
        }
    }

    public struct ImageStateChangeReason: AWSDecodableShape {
        /// The state change reason code.
        public let code: ImageStateChangeReasonCode?
        /// The state change reason message.
        public let message: String?

        public init(code: ImageStateChangeReasonCode? = nil, message: String? = nil) {
            self.code = code
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case code = "Code"
            case message = "Message"
        }
    }

    public struct LastReportGenerationExecutionError: AWSDecodableShape {
        /// The error code for the error that is returned when a usage report can't be generated.
        public let errorCode: UsageReportExecutionErrorCode?
        /// The error message for the error that is returned when a usage report can't be generated.
        public let errorMessage: String?

        public init(errorCode: UsageReportExecutionErrorCode? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct ListAssociatedFleetsRequest: AWSEncodableShape {
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?
        /// The name of the stack.
        public let stackName: String

        public init(nextToken: String? = nil, stackName: String) {
            self.nextToken = nextToken
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case stackName = "StackName"
        }
    }

    public struct ListAssociatedFleetsResult: AWSDecodableShape {
        /// The name of the fleet.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(names: [String]? = nil, nextToken: String? = nil) {
            self.names = names
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct ListAssociatedStacksRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let fleetName: String
        /// The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.
        public let nextToken: String?

        public init(fleetName: String, nextToken: String? = nil) {
            self.fleetName = fleetName
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.fleetName, name: "fleetName", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case fleetName = "FleetName"
            case nextToken = "NextToken"
        }
    }

    public struct ListAssociatedStacksResult: AWSDecodableShape {
        /// The name of the stack.
        public let names: [String]?
        /// The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.
        public let nextToken: String?

        public init(names: [String]? = nil, nextToken: String? = nil) {
            self.names = names
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case names = "Names"
            case nextToken = "NextToken"
        }
    }

    public struct ListEntitledApplicationsRequest: AWSEncodableShape {
        /// The name of the entitlement.
        public let entitlementName: String
        /// The maximum size of each page of results.
        public let maxResults: Int?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(entitlementName: String, maxResults: Int? = nil, nextToken: String? = nil, stackName: String) {
            self.entitlementName = entitlementName
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.validate(self.entitlementName, name: "entitlementName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case entitlementName = "EntitlementName"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case stackName = "StackName"
        }
    }

    public struct ListEntitledApplicationsResult: AWSDecodableShape {
        /// The entitled applications.
        public let entitledApplications: [EntitledApplication]?
        /// The pagination token used to retrieve the next page of results for this operation.
        public let nextToken: String?

        public init(entitledApplications: [EntitledApplication]? = nil, nextToken: String? = nil) {
            self.entitledApplications = entitledApplications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case entitledApplications = "EntitledApplications"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The information about the tags.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct NetworkAccessConfiguration: AWSDecodableShape {
        /// The resource identifier of the elastic network interface that is attached to instances in your VPC. All network interfaces have the eni-xxxxxxxx resource identifier.
        public let eniId: String?
        /// The private IP address of the elastic network interface that is attached to instances in your VPC.
        public let eniPrivateIpAddress: String?

        public init(eniId: String? = nil, eniPrivateIpAddress: String? = nil) {
            self.eniId = eniId
            self.eniPrivateIpAddress = eniPrivateIpAddress
        }

        private enum CodingKeys: String, CodingKey {
            case eniId = "EniId"
            case eniPrivateIpAddress = "EniPrivateIpAddress"
        }
    }

    public struct ResourceError: AWSDecodableShape {
        /// The error code.
        public let errorCode: FleetErrorCode?
        /// The error message.
        public let errorMessage: String?
        /// The time the error occurred.
        public let errorTimestamp: Date?

        public init(errorCode: FleetErrorCode? = nil, errorMessage: String? = nil, errorTimestamp: Date? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.errorTimestamp = errorTimestamp
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case errorTimestamp = "ErrorTimestamp"
        }
    }

    public struct S3Location: AWSEncodableShape & AWSDecodableShape {
        /// The S3 bucket of the S3 object.
        public let s3Bucket: String
        /// The S3 key of the S3 object.
        public let s3Key: String

        public init(s3Bucket: String, s3Key: String) {
            self.s3Bucket = s3Bucket
            self.s3Key = s3Key
        }

        public func validate(name: String) throws {
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, max: 63)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, min: 3)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, pattern: "^[0-9a-z\\.\\-]*(?<!\\.)$")
            try self.validate(self.s3Key, name: "s3Key", parent: name, max: 1024)
            try self.validate(self.s3Key, name: "s3Key", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case s3Bucket = "S3Bucket"
            case s3Key = "S3Key"
        }
    }

    public struct ScriptDetails: AWSEncodableShape & AWSDecodableShape {
        /// The runtime parameters passed to the run path for the script.
        public let executableParameters: String?
        /// The run path for the script.
        public let executablePath: String
        /// The S3 object location for the script.
        public let scriptS3Location: S3Location
        /// The run timeout, in seconds, for the script.
        public let timeoutInSeconds: Int

        public init(executableParameters: String? = nil, executablePath: String, scriptS3Location: S3Location, timeoutInSeconds: Int) {
            self.executableParameters = executableParameters
            self.executablePath = executablePath
            self.scriptS3Location = scriptS3Location
            self.timeoutInSeconds = timeoutInSeconds
        }

        public func validate(name: String) throws {
            try self.validate(self.executableParameters, name: "executableParameters", parent: name, min: 1)
            try self.validate(self.executablePath, name: "executablePath", parent: name, min: 1)
            try self.scriptS3Location.validate(name: "\(name).scriptS3Location")
        }

        private enum CodingKeys: String, CodingKey {
            case executableParameters = "ExecutableParameters"
            case executablePath = "ExecutablePath"
            case scriptS3Location = "ScriptS3Location"
            case timeoutInSeconds = "TimeoutInSeconds"
        }
    }

    public struct ServiceAccountCredentials: AWSEncodableShape & AWSDecodableShape {
        /// The user name of the account. This account must have the following privileges: create computer objects,  join computers to the domain, and change/reset the password on descendant computer objects for the  organizational units specified.
        public let accountName: String
        /// The password for the account.
        public let accountPassword: String

        public init(accountName: String, accountPassword: String) {
            self.accountName = accountName
            self.accountPassword = accountPassword
        }

        public func validate(name: String) throws {
            try self.validate(self.accountName, name: "accountName", parent: name, min: 1)
            try self.validate(self.accountPassword, name: "accountPassword", parent: name, max: 127)
            try self.validate(self.accountPassword, name: "accountPassword", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accountName = "AccountName"
            case accountPassword = "AccountPassword"
        }
    }

    public struct Session: AWSDecodableShape {
        /// The authentication method. The user is authenticated using a streaming URL (API) or SAML 2.0 federation (SAML).
        public let authenticationType: AuthenticationType?
        /// Specifies whether a user is connected to the streaming session.
        public let connectionState: SessionConnectionState?
        /// The name of the fleet for the streaming session.
        public let fleetName: String
        /// The identifier of the streaming session.
        public let id: String
        /// The time when the streaming session is set to expire. This time is based on the MaxUserDurationinSeconds value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in SessionMaxExpirationTime, when the DisconnectTimeOutInSeconds elapses or the user chooses to end his or her session. If the DisconnectTimeOutInSeconds elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.
        public let maxExpirationTime: Date?
        /// The network details for the streaming session.
        public let networkAccessConfiguration: NetworkAccessConfiguration?
        /// The name of the stack for the streaming session.
        public let stackName: String
        /// The time when a streaming instance is dedicated for the user.
        public let startTime: Date?
        /// The current state of the streaming session.
        public let state: SessionState
        /// The identifier of the user for whom the session was created.
        public let userId: String

        public init(authenticationType: AuthenticationType? = nil, connectionState: SessionConnectionState? = nil, fleetName: String, id: String, maxExpirationTime: Date? = nil, networkAccessConfiguration: NetworkAccessConfiguration? = nil, stackName: String, startTime: Date? = nil, state: SessionState, userId: String) {
            self.authenticationType = authenticationType
            self.connectionState = connectionState
            self.fleetName = fleetName
            self.id = id
            self.maxExpirationTime = maxExpirationTime
            self.networkAccessConfiguration = networkAccessConfiguration
            self.stackName = stackName
            self.startTime = startTime
            self.state = state
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case connectionState = "ConnectionState"
            case fleetName = "FleetName"
            case id = "Id"
            case maxExpirationTime = "MaxExpirationTime"
            case networkAccessConfiguration = "NetworkAccessConfiguration"
            case stackName = "StackName"
            case startTime = "StartTime"
            case state = "State"
            case userId = "UserId"
        }
    }

    public struct SharedImagePermissions: AWSDecodableShape {
        /// Describes the permissions for a shared image.
        public let imagePermissions: ImagePermissions
        /// The 12-digit identifier of the AWS account with which the image is shared.
        public let sharedAccountId: String

        public init(imagePermissions: ImagePermissions, sharedAccountId: String) {
            self.imagePermissions = imagePermissions
            self.sharedAccountId = sharedAccountId
        }

        private enum CodingKeys: String, CodingKey {
            case imagePermissions
            case sharedAccountId
        }
    }

    public struct Stack: AWSDecodableShape {
        /// The list of virtual private cloud (VPC) interface endpoint objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.
        public let accessEndpoints: [AccessEndpoint]?
        /// The persistent application settings for users of the stack.
        public let applicationSettings: ApplicationSettingsResponse?
        /// The ARN of the stack.
        public let arn: String?
        /// The time the stack was created.
        public let createdTime: Date?
        /// The description to display.
        public let description: String?
        /// The stack name to display.
        public let displayName: String?
        /// The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.
        public let embedHostDomains: [String]?
        /// The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.
        public let feedbackURL: String?
        /// The name of the stack.
        public let name: String
        /// The URL that users are redirected to after their streaming session ends.
        public let redirectURL: String?
        /// The errors for the stack.
        public let stackErrors: [StackError]?
        /// The storage connectors to enable.
        public let storageConnectors: [StorageConnector]?
        /// The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.
        public let streamingExperienceSettings: StreamingExperienceSettings?
        /// The actions that are enabled or disabled for users during their streaming sessions. By default these actions are enabled.
        public let userSettings: [UserSetting]?

        public init(accessEndpoints: [AccessEndpoint]? = nil, applicationSettings: ApplicationSettingsResponse? = nil, arn: String? = nil, createdTime: Date? = nil, description: String? = nil, displayName: String? = nil, embedHostDomains: [String]? = nil, feedbackURL: String? = nil, name: String, redirectURL: String? = nil, stackErrors: [StackError]? = nil, storageConnectors: [StorageConnector]? = nil, streamingExperienceSettings: StreamingExperienceSettings? = nil, userSettings: [UserSetting]? = nil) {
            self.accessEndpoints = accessEndpoints
            self.applicationSettings = applicationSettings
            self.arn = arn
            self.createdTime = createdTime
            self.description = description
            self.displayName = displayName
            self.embedHostDomains = embedHostDomains
            self.feedbackURL = feedbackURL
            self.name = name
            self.redirectURL = redirectURL
            self.stackErrors = stackErrors
            self.storageConnectors = storageConnectors
            self.streamingExperienceSettings = streamingExperienceSettings
            self.userSettings = userSettings
        }

        private enum CodingKeys: String, CodingKey {
            case accessEndpoints = "AccessEndpoints"
            case applicationSettings = "ApplicationSettings"
            case arn = "Arn"
            case createdTime = "CreatedTime"
            case description = "Description"
            case displayName = "DisplayName"
            case embedHostDomains = "EmbedHostDomains"
            case feedbackURL = "FeedbackURL"
            case name = "Name"
            case redirectURL = "RedirectURL"
            case stackErrors = "StackErrors"
            case storageConnectors = "StorageConnectors"
            case streamingExperienceSettings = "StreamingExperienceSettings"
            case userSettings = "UserSettings"
        }
    }

    public struct StackError: AWSDecodableShape {
        /// The error code.
        public let errorCode: StackErrorCode?
        /// The error message.
        public let errorMessage: String?

        public init(errorCode: StackErrorCode? = nil, errorMessage: String? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
        }
    }

    public struct StartFleetRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct StartFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct StartImageBuilderRequest: AWSEncodableShape {
        /// The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify [LATEST].
        public let appstreamAgentVersion: String?
        /// The name of the image builder.
        public let name: String

        public init(appstreamAgentVersion: String? = nil, name: String) {
            self.appstreamAgentVersion = appstreamAgentVersion
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.appstreamAgentVersion, name: "appstreamAgentVersion", parent: name, max: 100)
            try self.validate(self.appstreamAgentVersion, name: "appstreamAgentVersion", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case appstreamAgentVersion = "AppstreamAgentVersion"
            case name = "Name"
        }
    }

    public struct StartImageBuilderResult: AWSDecodableShape {
        /// Information about the image builder.
        public let imageBuilder: ImageBuilder?

        public init(imageBuilder: ImageBuilder? = nil) {
            self.imageBuilder = imageBuilder
        }

        private enum CodingKeys: String, CodingKey {
            case imageBuilder = "ImageBuilder"
        }
    }

    public struct StopFleetRequest: AWSEncodableShape {
        /// The name of the fleet.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct StopFleetResult: AWSDecodableShape {
        public init() {}
    }

    public struct StopImageBuilderRequest: AWSEncodableShape {
        /// The name of the image builder.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct StopImageBuilderResult: AWSDecodableShape {
        /// Information about the image builder.
        public let imageBuilder: ImageBuilder?

        public init(imageBuilder: ImageBuilder? = nil) {
            self.imageBuilder = imageBuilder
        }

        private enum CodingKeys: String, CodingKey {
            case imageBuilder = "ImageBuilder"
        }
    }

    public struct StorageConnector: AWSEncodableShape & AWSDecodableShape {
        /// The type of storage connector.
        public let connectorType: StorageConnectorType
        /// The names of the domains for the account.
        public let domains: [String]?
        /// The ARN of the storage connector.
        public let resourceIdentifier: String?

        public init(connectorType: StorageConnectorType, domains: [String]? = nil, resourceIdentifier: String? = nil) {
            self.connectorType = connectorType
            self.domains = domains
            self.resourceIdentifier = resourceIdentifier
        }

        public func validate(name: String) throws {
            try self.domains?.forEach {
                try validate($0, name: "domains[]", parent: name, max: 64)
                try validate($0, name: "domains[]", parent: name, min: 1)
            }
            try self.validate(self.domains, name: "domains", parent: name, max: 50)
            try self.validate(self.resourceIdentifier, name: "resourceIdentifier", parent: name, max: 2048)
            try self.validate(self.resourceIdentifier, name: "resourceIdentifier", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case connectorType = "ConnectorType"
            case domains = "Domains"
            case resourceIdentifier = "ResourceIdentifier"
        }
    }

    public struct StreamingExperienceSettings: AWSEncodableShape & AWSDecodableShape {
        /// The preferred protocol that you want to use while streaming your application.
        public let preferredProtocol: PreferredProtocol?

        public init(preferredProtocol: PreferredProtocol? = nil) {
            self.preferredProtocol = preferredProtocol
        }

        private enum CodingKeys: String, CodingKey {
            case preferredProtocol = "PreferredProtocol"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String
        /// The tags to associate. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.   If you do not specify a value, the value is set to an empty string.  Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:  _ . : / = + \ - @
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.tags, name: "tags", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String
        /// The tag keys for the tags to disassociate.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^(^(?!aws:).[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateApplicationRequest: AWSEncodableShape {
        /// The ARN of the app block.
        public let appBlockArn: String?
        /// The attributes to delete for an application.
        public let attributesToDelete: [ApplicationAttribute]?
        /// The description of the application.
        public let description: String?
        /// The display name of the application. This name is visible to users in the application catalog.
        public let displayName: String?
        /// The icon S3 location of the application.
        public let iconS3Location: S3Location?
        /// The launch parameters of the application.
        public let launchParameters: String?
        /// The launch path of the application.
        public let launchPath: String?
        /// The name of the application. This name is visible to users when display name is not specified.
        public let name: String
        /// The working directory of the application.
        public let workingDirectory: String?

        public init(appBlockArn: String? = nil, attributesToDelete: [ApplicationAttribute]? = nil, description: String? = nil, displayName: String? = nil, iconS3Location: S3Location? = nil, launchParameters: String? = nil, launchPath: String? = nil, name: String, workingDirectory: String? = nil) {
            self.appBlockArn = appBlockArn
            self.attributesToDelete = attributesToDelete
            self.description = description
            self.displayName = displayName
            self.iconS3Location = iconS3Location
            self.launchParameters = launchParameters
            self.launchPath = launchPath
            self.name = name
            self.workingDirectory = workingDirectory
        }

        public func validate(name: String) throws {
            try self.validate(self.appBlockArn, name: "appBlockArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.attributesToDelete, name: "attributesToDelete", parent: name, max: 2)
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.iconS3Location?.validate(name: "\(name).iconS3Location")
            try self.validate(self.launchParameters, name: "launchParameters", parent: name, min: 1)
            try self.validate(self.launchPath, name: "launchPath", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.workingDirectory, name: "workingDirectory", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case appBlockArn = "AppBlockArn"
            case attributesToDelete = "AttributesToDelete"
            case description = "Description"
            case displayName = "DisplayName"
            case iconS3Location = "IconS3Location"
            case launchParameters = "LaunchParameters"
            case launchPath = "LaunchPath"
            case name = "Name"
            case workingDirectory = "WorkingDirectory"
        }
    }

    public struct UpdateApplicationResult: AWSDecodableShape {
        public let application: Application?

        public init(application: Application? = nil) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "Application"
        }
    }

    public struct UpdateDirectoryConfigRequest: AWSEncodableShape {
        /// The certificate-based authentication properties used to authenticate SAML 2.0 Identity Provider (IdP) user identities to Active Directory domain-joined streaming instances. Fallback is turned on by default when certificate-based authentication is Enabled . Fallback allows users to log in using their AD domain password if certificate-based authentication is unsuccessful, or to unlock a desktop lock screen. Enabled_no_directory_login_fallback enables certificate-based authentication, but does not allow users to log in using their AD domain password. Users will be disconnected to re-authenticate using certificates.
        public let certificateBasedAuthProperties: CertificateBasedAuthProperties?
        /// The name of the Directory Config object.
        public let directoryName: String
        /// The distinguished names of the organizational units for computer accounts.
        public let organizationalUnitDistinguishedNames: [String]?
        /// The credentials for the service account used by the fleet or image builder to connect to the directory.
        public let serviceAccountCredentials: ServiceAccountCredentials?

        public init(certificateBasedAuthProperties: CertificateBasedAuthProperties? = nil, directoryName: String, organizationalUnitDistinguishedNames: [String]? = nil, serviceAccountCredentials: ServiceAccountCredentials? = nil) {
            self.certificateBasedAuthProperties = certificateBasedAuthProperties
            self.directoryName = directoryName
            self.organizationalUnitDistinguishedNames = organizationalUnitDistinguishedNames
            self.serviceAccountCredentials = serviceAccountCredentials
        }

        public func validate(name: String) throws {
            try self.certificateBasedAuthProperties?.validate(name: "\(name).certificateBasedAuthProperties")
            try self.organizationalUnitDistinguishedNames?.forEach {
                try validate($0, name: "organizationalUnitDistinguishedNames[]", parent: name, max: 2000)
            }
            try self.serviceAccountCredentials?.validate(name: "\(name).serviceAccountCredentials")
        }

        private enum CodingKeys: String, CodingKey {
            case certificateBasedAuthProperties = "CertificateBasedAuthProperties"
            case directoryName = "DirectoryName"
            case organizationalUnitDistinguishedNames = "OrganizationalUnitDistinguishedNames"
            case serviceAccountCredentials = "ServiceAccountCredentials"
        }
    }

    public struct UpdateDirectoryConfigResult: AWSDecodableShape {
        /// Information about the Directory Config object.
        public let directoryConfig: DirectoryConfig?

        public init(directoryConfig: DirectoryConfig? = nil) {
            self.directoryConfig = directoryConfig
        }

        private enum CodingKeys: String, CodingKey {
            case directoryConfig = "DirectoryConfig"
        }
    }

    public struct UpdateEntitlementRequest: AWSEncodableShape {
        /// Specifies whether all or only selected apps are entitled.
        public let appVisibility: AppVisibility?
        /// The attributes of the entitlement.
        public let attributes: [EntitlementAttribute]?
        /// The description of the entitlement.
        public let description: String?
        /// The name of the entitlement.
        public let name: String
        /// The name of the stack with which the entitlement is associated.
        public let stackName: String

        public init(appVisibility: AppVisibility? = nil, attributes: [EntitlementAttribute]? = nil, description: String? = nil, name: String, stackName: String) {
            self.appVisibility = appVisibility
            self.attributes = attributes
            self.description = description
            self.name = name
            self.stackName = stackName
        }

        public func validate(name: String) throws {
            try self.attributes?.forEach {
                try $0.validate(name: "\(name).attributes[]")
            }
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.stackName, name: "stackName", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
        }

        private enum CodingKeys: String, CodingKey {
            case appVisibility = "AppVisibility"
            case attributes = "Attributes"
            case description = "Description"
            case name = "Name"
            case stackName = "StackName"
        }
    }

    public struct UpdateEntitlementResult: AWSDecodableShape {
        /// The entitlement.
        public let entitlement: Entitlement?

        public init(entitlement: Entitlement? = nil) {
            self.entitlement = entitlement
        }

        private enum CodingKeys: String, CodingKey {
            case entitlement = "Entitlement"
        }
    }

    public struct UpdateFleetRequest: AWSEncodableShape {
        /// The fleet attributes to delete.
        public let attributesToDelete: [FleetAttribute]?
        /// The desired capacity for the fleet. This is not allowed for Elastic fleets.
        public let computeCapacity: ComputeCapacity?
        /// Deletes the VPC association for the specified fleet.
        public let deleteVpcConfig: Bool?
        /// The description to display.
        public let description: String?
        /// The amount of time that a streaming session remains active after users disconnect. If users try to reconnect to the streaming session after a disconnection or network interruption within this time interval, they are connected to their previous session. Otherwise, they are connected to a new session with a new streaming instance.  Specify a value between 60 and 360000.
        public let disconnectTimeoutInSeconds: Int?
        /// The fleet name to display.
        public let displayName: String?
        /// The name of the directory and organizational unit (OU) to use to join the fleet to a Microsoft Active Directory domain.
        public let domainJoinInfo: DomainJoinInfo?
        /// Enables or disables default internet access for the fleet.
        public let enableDefaultInternetAccess: Bool?
        /// The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume a role, a fleet instance calls the AWS Security Token Service (STS) AssumeRole API operation and passes the ARN of the role to use. The operation creates a new session with temporary credentials. AppStream 2.0 retrieves the temporary credentials and creates the appstream_machine_role credential profile on the instance.  For more information, see Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances in the Amazon AppStream 2.0 Administration Guide.
        public let iamRoleArn: String?
        /// The amount of time that users can be idle (inactive) before they are disconnected from their streaming session and the DisconnectTimeoutInSeconds time interval begins. Users are notified before they are disconnected due to inactivity. If users try to reconnect to the streaming session before the time interval specified in DisconnectTimeoutInSeconds elapses, they are connected to their previous session. Users are considered idle when they stop providing keyboard or mouse input during their streaming session. File uploads and downloads, audio in, audio out, and pixels changing do not qualify as user activity. If users continue to be idle after the time interval in IdleDisconnectTimeoutInSeconds elapses, they are disconnected.  To prevent users from being disconnected due to inactivity, specify a value of 0. Otherwise, specify a value between 60 and 3600. The default value is 0.   If you enable this feature, we recommend that you specify a value that corresponds exactly to a whole number of minutes (for example, 60, 120, and 180). If you don't do this, the value is rounded to the nearest minute. For example, if you specify a value of 70, users are disconnected after 1 minute of inactivity. If you specify a value that is at the midpoint between two different minutes, the value is rounded up. For example, if you specify a value of 90, users are disconnected after 2 minutes of inactivity.
        public let idleDisconnectTimeoutInSeconds: Int?
        /// The ARN of the public, private, or shared image to use.
        public let imageArn: String?
        /// The name of the image used to create the fleet.
        public let imageName: String?
        /// The instance type to use when launching fleet instances. The following instance types are available:   stream.standard.small   stream.standard.medium   stream.standard.large   stream.standard.xlarge   stream.standard.2xlarge   stream.compute.large   stream.compute.xlarge   stream.compute.2xlarge   stream.compute.4xlarge   stream.compute.8xlarge   stream.memory.large   stream.memory.xlarge   stream.memory.2xlarge   stream.memory.4xlarge   stream.memory.8xlarge   stream.memory.z1d.large   stream.memory.z1d.xlarge   stream.memory.z1d.2xlarge   stream.memory.z1d.3xlarge   stream.memory.z1d.6xlarge   stream.memory.z1d.12xlarge   stream.graphics-design.large   stream.graphics-design.xlarge   stream.graphics-design.2xlarge   stream.graphics-design.4xlarge   stream.graphics-desktop.2xlarge   stream.graphics.g4dn.xlarge   stream.graphics.g4dn.2xlarge   stream.graphics.g4dn.4xlarge   stream.graphics.g4dn.8xlarge   stream.graphics.g4dn.12xlarge   stream.graphics.g4dn.16xlarge   stream.graphics-pro.4xlarge   stream.graphics-pro.8xlarge   stream.graphics-pro.16xlarge   The following instance types are available for Elastic fleets:   stream.standard.small   stream.standard.medium   stream.standard.large   stream.standard.xlarge   stream.standard.2xlarge
        public let instanceType: String?
        /// The maximum number of concurrent sessions for a fleet.
        public let maxConcurrentSessions: Int?
        /// The maximum amount of time that a streaming session can remain active, in seconds. If users are still connected to a streaming instance five minutes before this limit is reached, they are prompted to save any open documents before being disconnected. After this time elapses, the instance is terminated and replaced by a new instance. Specify a value between 600 and 360000.
        public let maxUserDurationInSeconds: Int?
        /// A unique name for the fleet.
        public let name: String?
        /// The platform of the fleet. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for Elastic fleets.
        public let platform: PlatformType?
        /// The S3 location of the session scripts configuration zip file. This only applies to Elastic fleets.
        public let sessionScriptS3Location: S3Location?
        /// The AppStream 2.0 view that is displayed to your users when they stream from the fleet. When APP is specified, only the windows of applications opened by users display. When DESKTOP is specified, the standard desktop that is provided by the operating system displays.  The default value is APP.
        public let streamView: StreamView?
        /// The USB device filter strings that specify which USB devices a user can redirect to the fleet streaming session, when using the Windows native client. This is allowed but not required for Elastic fleets.
        public let usbDeviceFilterStrings: [String]?
        /// The VPC configuration for the fleet. This is required for Elastic fleets, but not required for other fleet types. Elastic fleets require that you specify at least two subnets in different availability zones.
        public let vpcConfig: VpcConfig?

        public init(attributesToDelete: [FleetAttribute]? = nil, computeCapacity: ComputeCapacity? = nil, description: String? = nil, disconnectTimeoutInSeconds: Int? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, iamRoleArn: String? = nil, idleDisconnectTimeoutInSeconds: Int? = nil, imageArn: String? = nil, imageName: String? = nil, instanceType: String? = nil, maxConcurrentSessions: Int? = nil, maxUserDurationInSeconds: Int? = nil, name: String? = nil, platform: PlatformType? = nil, sessionScriptS3Location: S3Location? = nil, streamView: StreamView? = nil, usbDeviceFilterStrings: [String]? = nil, vpcConfig: VpcConfig? = nil) {
            self.attributesToDelete = attributesToDelete
            self.computeCapacity = computeCapacity
            self.deleteVpcConfig = nil
            self.description = description
            self.disconnectTimeoutInSeconds = disconnectTimeoutInSeconds
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.iamRoleArn = iamRoleArn
            self.idleDisconnectTimeoutInSeconds = idleDisconnectTimeoutInSeconds
            self.imageArn = imageArn
            self.imageName = imageName
            self.instanceType = instanceType
            self.maxConcurrentSessions = maxConcurrentSessions
            self.maxUserDurationInSeconds = maxUserDurationInSeconds
            self.name = name
            self.platform = platform
            self.sessionScriptS3Location = sessionScriptS3Location
            self.streamView = streamView
            self.usbDeviceFilterStrings = usbDeviceFilterStrings
            self.vpcConfig = vpcConfig
        }

        @available(*, deprecated, message: "Members deleteVpcConfig have been deprecated")
        public init(attributesToDelete: [FleetAttribute]? = nil, computeCapacity: ComputeCapacity? = nil, deleteVpcConfig: Bool? = nil, description: String? = nil, disconnectTimeoutInSeconds: Int? = nil, displayName: String? = nil, domainJoinInfo: DomainJoinInfo? = nil, enableDefaultInternetAccess: Bool? = nil, iamRoleArn: String? = nil, idleDisconnectTimeoutInSeconds: Int? = nil, imageArn: String? = nil, imageName: String? = nil, instanceType: String? = nil, maxConcurrentSessions: Int? = nil, maxUserDurationInSeconds: Int? = nil, name: String? = nil, platform: PlatformType? = nil, sessionScriptS3Location: S3Location? = nil, streamView: StreamView? = nil, usbDeviceFilterStrings: [String]? = nil, vpcConfig: VpcConfig? = nil) {
            self.attributesToDelete = attributesToDelete
            self.computeCapacity = computeCapacity
            self.deleteVpcConfig = deleteVpcConfig
            self.description = description
            self.disconnectTimeoutInSeconds = disconnectTimeoutInSeconds
            self.displayName = displayName
            self.domainJoinInfo = domainJoinInfo
            self.enableDefaultInternetAccess = enableDefaultInternetAccess
            self.iamRoleArn = iamRoleArn
            self.idleDisconnectTimeoutInSeconds = idleDisconnectTimeoutInSeconds
            self.imageArn = imageArn
            self.imageName = imageName
            self.instanceType = instanceType
            self.maxConcurrentSessions = maxConcurrentSessions
            self.maxUserDurationInSeconds = maxUserDurationInSeconds
            self.name = name
            self.platform = platform
            self.sessionScriptS3Location = sessionScriptS3Location
            self.streamView = streamView
            self.usbDeviceFilterStrings = usbDeviceFilterStrings
            self.vpcConfig = vpcConfig
        }

        public func validate(name: String) throws {
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.domainJoinInfo?.validate(name: "\(name).domainJoinInfo")
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageArn, name: "imageArn", parent: name, pattern: "^arn:aws(?:\\-cn|\\-iso\\-b|\\-iso|\\-us\\-gov)?:[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9_/.-]{0,63}:[A-Za-z0-9][A-Za-z0-9:_/+=,@.\\\\-]{0,1023}$")
            try self.validate(self.imageName, name: "imageName", parent: name, min: 1)
            try self.validate(self.instanceType, name: "instanceType", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.sessionScriptS3Location?.validate(name: "\(name).sessionScriptS3Location")
            try self.usbDeviceFilterStrings?.forEach {
                try validate($0, name: "usbDeviceFilterStrings[]", parent: name, max: 100)
                try validate($0, name: "usbDeviceFilterStrings[]", parent: name, pattern: "^((\\w*)\\s*(\\w*)\\s*\\,\\s*(\\w*)\\s*\\,\\s*\\*?(\\w*)\\s*\\,\\s*\\*?(\\w*)\\s*\\,\\s*\\*?\\d*\\s*\\,\\s*\\*?\\d*\\s*\\,\\s*[0-1]\\s*\\,\\s*[0-1]\\s*)$")
            }
            try self.vpcConfig?.validate(name: "\(name).vpcConfig")
        }

        private enum CodingKeys: String, CodingKey {
            case attributesToDelete = "AttributesToDelete"
            case computeCapacity = "ComputeCapacity"
            case deleteVpcConfig = "DeleteVpcConfig"
            case description = "Description"
            case disconnectTimeoutInSeconds = "DisconnectTimeoutInSeconds"
            case displayName = "DisplayName"
            case domainJoinInfo = "DomainJoinInfo"
            case enableDefaultInternetAccess = "EnableDefaultInternetAccess"
            case iamRoleArn = "IamRoleArn"
            case idleDisconnectTimeoutInSeconds = "IdleDisconnectTimeoutInSeconds"
            case imageArn = "ImageArn"
            case imageName = "ImageName"
            case instanceType = "InstanceType"
            case maxConcurrentSessions = "MaxConcurrentSessions"
            case maxUserDurationInSeconds = "MaxUserDurationInSeconds"
            case name = "Name"
            case platform = "Platform"
            case sessionScriptS3Location = "SessionScriptS3Location"
            case streamView = "StreamView"
            case usbDeviceFilterStrings = "UsbDeviceFilterStrings"
            case vpcConfig = "VpcConfig"
        }
    }

    public struct UpdateFleetResult: AWSDecodableShape {
        /// Information about the fleet.
        public let fleet: Fleet?

        public init(fleet: Fleet? = nil) {
            self.fleet = fleet
        }

        private enum CodingKeys: String, CodingKey {
            case fleet = "Fleet"
        }
    }

    public struct UpdateImagePermissionsRequest: AWSEncodableShape {
        /// The permissions for the image.
        public let imagePermissions: ImagePermissions
        /// The name of the private image.
        public let name: String
        /// The 12-digit identifier of the AWS account for which you want add or update image permissions.
        public let sharedAccountId: String

        public init(imagePermissions: ImagePermissions, name: String, sharedAccountId: String) {
            self.imagePermissions = imagePermissions
            self.name = name
            self.sharedAccountId = sharedAccountId
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,100}$")
            try self.validate(self.sharedAccountId, name: "sharedAccountId", parent: name, pattern: "^\\d+$")
        }

        private enum CodingKeys: String, CodingKey {
            case imagePermissions = "ImagePermissions"
            case name = "Name"
            case sharedAccountId = "SharedAccountId"
        }
    }

    public struct UpdateImagePermissionsResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateStackRequest: AWSEncodableShape {
        /// The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.
        public let accessEndpoints: [AccessEndpoint]?
        /// The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.
        public let applicationSettings: ApplicationSettings?
        /// The stack attributes to delete.
        public let attributesToDelete: [StackAttribute]?
        /// Deletes the storage connectors currently enabled for the stack.
        public let deleteStorageConnectors: Bool?
        /// The description to display.
        public let description: String?
        /// The stack name to display.
        public let displayName: String?
        /// The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.
        public let embedHostDomains: [String]?
        /// The URL that users are redirected to after they choose the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.
        public let feedbackURL: String?
        /// The name of the stack.
        public let name: String
        /// The URL that users are redirected to after their streaming session ends.
        public let redirectURL: String?
        /// The storage connectors to enable.
        public let storageConnectors: [StorageConnector]?
        /// The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.
        public let streamingExperienceSettings: StreamingExperienceSettings?
        /// The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.
        public let userSettings: [UserSetting]?

        public init(accessEndpoints: [AccessEndpoint]? = nil, applicationSettings: ApplicationSettings? = nil, attributesToDelete: [StackAttribute]? = nil, description: String? = nil, displayName: String? = nil, embedHostDomains: [String]? = nil, feedbackURL: String? = nil, name: String, redirectURL: String? = nil, storageConnectors: [StorageConnector]? = nil, streamingExperienceSettings: StreamingExperienceSettings? = nil, userSettings: [UserSetting]? = nil) {
            self.accessEndpoints = accessEndpoints
            self.applicationSettings = applicationSettings
            self.attributesToDelete = attributesToDelete
            self.deleteStorageConnectors = nil
            self.description = description
            self.displayName = displayName
            self.embedHostDomains = embedHostDomains
            self.feedbackURL = feedbackURL
            self.name = name
            self.redirectURL = redirectURL
            self.storageConnectors = storageConnectors
            self.streamingExperienceSettings = streamingExperienceSettings
            self.userSettings = userSettings
        }

        @available(*, deprecated, message: "Members deleteStorageConnectors have been deprecated")
        public init(accessEndpoints: [AccessEndpoint]? = nil, applicationSettings: ApplicationSettings? = nil, attributesToDelete: [StackAttribute]? = nil, deleteStorageConnectors: Bool? = nil, description: String? = nil, displayName: String? = nil, embedHostDomains: [String]? = nil, feedbackURL: String? = nil, name: String, redirectURL: String? = nil, storageConnectors: [StorageConnector]? = nil, streamingExperienceSettings: StreamingExperienceSettings? = nil, userSettings: [UserSetting]? = nil) {
            self.accessEndpoints = accessEndpoints
            self.applicationSettings = applicationSettings
            self.attributesToDelete = attributesToDelete
            self.deleteStorageConnectors = deleteStorageConnectors
            self.description = description
            self.displayName = displayName
            self.embedHostDomains = embedHostDomains
            self.feedbackURL = feedbackURL
            self.name = name
            self.redirectURL = redirectURL
            self.storageConnectors = storageConnectors
            self.streamingExperienceSettings = streamingExperienceSettings
            self.userSettings = userSettings
        }

        public func validate(name: String) throws {
            try self.accessEndpoints?.forEach {
                try $0.validate(name: "\(name).accessEndpoints[]")
            }
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, max: 4)
            try self.validate(self.accessEndpoints, name: "accessEndpoints", parent: name, min: 1)
            try self.applicationSettings?.validate(name: "\(name).applicationSettings")
            try self.validate(self.description, name: "description", parent: name, max: 256)
            try self.validate(self.displayName, name: "displayName", parent: name, max: 100)
            try self.embedHostDomains?.forEach {
                try validate($0, name: "embedHostDomains[]", parent: name, max: 128)
                try validate($0, name: "embedHostDomains[]", parent: name, pattern: "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$")
            }
            try self.validate(self.embedHostDomains, name: "embedHostDomains", parent: name, max: 20)
            try self.validate(self.embedHostDomains, name: "embedHostDomains", parent: name, min: 1)
            try self.validate(self.feedbackURL, name: "feedbackURL", parent: name, max: 1000)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.redirectURL, name: "redirectURL", parent: name, max: 1000)
            try self.storageConnectors?.forEach {
                try $0.validate(name: "\(name).storageConnectors[]")
            }
            try self.validate(self.userSettings, name: "userSettings", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case accessEndpoints = "AccessEndpoints"
            case applicationSettings = "ApplicationSettings"
            case attributesToDelete = "AttributesToDelete"
            case deleteStorageConnectors = "DeleteStorageConnectors"
            case description = "Description"
            case displayName = "DisplayName"
            case embedHostDomains = "EmbedHostDomains"
            case feedbackURL = "FeedbackURL"
            case name = "Name"
            case redirectURL = "RedirectURL"
            case storageConnectors = "StorageConnectors"
            case streamingExperienceSettings = "StreamingExperienceSettings"
            case userSettings = "UserSettings"
        }
    }

    public struct UpdateStackResult: AWSDecodableShape {
        /// Information about the stack.
        public let stack: Stack?

        public init(stack: Stack? = nil) {
            self.stack = stack
        }

        private enum CodingKeys: String, CodingKey {
            case stack = "Stack"
        }
    }

    public struct UsageReportSubscription: AWSDecodableShape {
        /// The time when the last usage report was generated.
        public let lastGeneratedReportDate: Date?
        /// The Amazon S3 bucket where generated reports are stored.   If you enabled on-instance session scripts and Amazon S3 logging for your session script configuration, AppStream 2.0 created an S3 bucket to store the script output. The bucket is unique to your account and Region. When you enable usage reporting in this case, AppStream 2.0 uses the same bucket to store your usage reports. If you haven't already enabled on-instance session scripts,  when you enable usage reports, AppStream 2.0 creates a new S3 bucket.
        public let s3BucketName: String?
        /// The schedule for generating usage reports.
        public let schedule: UsageReportSchedule?
        /// The errors that were returned if usage reports couldn't be generated.
        public let subscriptionErrors: [LastReportGenerationExecutionError]?

        public init(lastGeneratedReportDate: Date? = nil, s3BucketName: String? = nil, schedule: UsageReportSchedule? = nil, subscriptionErrors: [LastReportGenerationExecutionError]? = nil) {
            self.lastGeneratedReportDate = lastGeneratedReportDate
            self.s3BucketName = s3BucketName
            self.schedule = schedule
            self.subscriptionErrors = subscriptionErrors
        }

        private enum CodingKeys: String, CodingKey {
            case lastGeneratedReportDate = "LastGeneratedReportDate"
            case s3BucketName = "S3BucketName"
            case schedule = "Schedule"
            case subscriptionErrors = "SubscriptionErrors"
        }
    }

    public struct User: AWSDecodableShape {
        /// The ARN of the user.
        public let arn: String?
        /// The authentication type for the user.
        public let authenticationType: AuthenticationType
        /// The date and time the user was created in the user pool.
        public let createdTime: Date?
        /// Specifies whether the user in the user pool is enabled.
        public let enabled: Bool?
        /// The first name, or given name, of the user.
        public let firstName: String?
        /// The last name, or surname, of the user.
        public let lastName: String?
        /// The status of the user in the user pool. The status can be one of the following:   UNCONFIRMED – The user is created but not confirmed.   CONFIRMED – The user is confirmed.   ARCHIVED – The user is no longer active.   COMPROMISED – The user is disabled because of a potential security threat.   UNKNOWN – The user status is not known.
        public let status: String?
        /// The email address of the user.   Users' email addresses are case-sensitive.
        public let userName: String?

        public init(arn: String? = nil, authenticationType: AuthenticationType, createdTime: Date? = nil, enabled: Bool? = nil, firstName: String? = nil, lastName: String? = nil, status: String? = nil, userName: String? = nil) {
            self.arn = arn
            self.authenticationType = authenticationType
            self.createdTime = createdTime
            self.enabled = enabled
            self.firstName = firstName
            self.lastName = lastName
            self.status = status
            self.userName = userName
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "Arn"
            case authenticationType = "AuthenticationType"
            case createdTime = "CreatedTime"
            case enabled = "Enabled"
            case firstName = "FirstName"
            case lastName = "LastName"
            case status = "Status"
            case userName = "UserName"
        }
    }

    public struct UserSetting: AWSEncodableShape & AWSDecodableShape {
        /// The action that is enabled or disabled.
        public let action: Action
        /// Indicates whether the action is enabled or disabled.
        public let permission: Permission

        public init(action: Action, permission: Permission) {
            self.action = action
            self.permission = permission
        }

        private enum CodingKeys: String, CodingKey {
            case action = "Action"
            case permission = "Permission"
        }
    }

    public struct UserStackAssociation: AWSEncodableShape & AWSDecodableShape {
        /// The authentication type for the user.
        public let authenticationType: AuthenticationType
        /// Specifies whether a welcome email is sent to a user after the user is created in the user pool.
        public let sendEmailNotification: Bool?
        /// The name of the stack that is associated with the user.
        public let stackName: String
        /// The email address of the user who is associated with the stack.   Users' email addresses are case-sensitive.
        public let userName: String

        public init(authenticationType: AuthenticationType, sendEmailNotification: Bool? = nil, stackName: String, userName: String) {
            self.authenticationType = authenticationType
            self.sendEmailNotification = sendEmailNotification
            self.stackName = stackName
            self.userName = userName
        }

        public func validate(name: String) throws {
            try self.validate(self.stackName, name: "stackName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, max: 128)
            try self.validate(self.userName, name: "userName", parent: name, min: 1)
            try self.validate(self.userName, name: "userName", parent: name, pattern: "^[\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case authenticationType = "AuthenticationType"
            case sendEmailNotification = "SendEmailNotification"
            case stackName = "StackName"
            case userName = "UserName"
        }
    }

    public struct UserStackAssociationError: AWSDecodableShape {
        /// The error code for the error that is returned when a user can’t be associated with or disassociated from a stack.
        public let errorCode: UserStackAssociationErrorCode?
        /// The error message for the error that is returned when a user can’t be associated with or disassociated from a stack.
        public let errorMessage: String?
        /// Information about the user and associated stack.
        public let userStackAssociation: UserStackAssociation?

        public init(errorCode: UserStackAssociationErrorCode? = nil, errorMessage: String? = nil, userStackAssociation: UserStackAssociation? = nil) {
            self.errorCode = errorCode
            self.errorMessage = errorMessage
            self.userStackAssociation = userStackAssociation
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case errorMessage = "ErrorMessage"
            case userStackAssociation = "UserStackAssociation"
        }
    }

    public struct VpcConfig: AWSEncodableShape & AWSDecodableShape {
        /// The identifiers of the security groups for the fleet or image builder.
        public let securityGroupIds: [String]?
        /// The identifiers of the subnets to which a network interface is attached from the fleet instance or image builder instance. Fleet instances use one or more subnets. Image builder instances use one subnet.
        public let subnetIds: [String]?

        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.securityGroupIds?.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, min: 1)
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 5)
            try self.subnetIds?.forEach {
                try validate($0, name: "subnetIds[]", parent: name, min: 1)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
        }
    }
}

// MARK: - Errors

/// Error enum for AppStream
public struct AppStreamErrorType: AWSErrorType {
    enum Code: String {
        case concurrentModificationException = "ConcurrentModificationException"
        case entitlementAlreadyExistsException = "EntitlementAlreadyExistsException"
        case entitlementNotFoundException = "EntitlementNotFoundException"
        case incompatibleImageException = "IncompatibleImageException"
        case invalidAccountStatusException = "InvalidAccountStatusException"
        case invalidParameterCombinationException = "InvalidParameterCombinationException"
        case invalidRoleException = "InvalidRoleException"
        case limitExceededException = "LimitExceededException"
        case operationNotPermittedException = "OperationNotPermittedException"
        case requestLimitExceededException = "RequestLimitExceededException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case resourceInUseException = "ResourceInUseException"
        case resourceNotAvailableException = "ResourceNotAvailableException"
        case resourceNotFoundException = "ResourceNotFoundException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize AppStream
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// An API error occurred. Wait a few minutes and try again.
    public static var concurrentModificationException: Self { .init(.concurrentModificationException) }
    /// The entitlement already exists.
    public static var entitlementAlreadyExistsException: Self { .init(.entitlementAlreadyExistsException) }
    /// The entitlement can&#39;t be found.
    public static var entitlementNotFoundException: Self { .init(.entitlementNotFoundException) }
    /// The image can&#39;t be updated because it&#39;s not compatible for updates.
    public static var incompatibleImageException: Self { .init(.incompatibleImageException) }
    /// The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support.
    public static var invalidAccountStatusException: Self { .init(.invalidAccountStatusException) }
    /// Indicates an incorrect combination of parameters, or a missing parameter.
    public static var invalidParameterCombinationException: Self { .init(.invalidParameterCombinationException) }
    /// The specified role is invalid.
    public static var invalidRoleException: Self { .init(.invalidRoleException) }
    /// The requested limit exceeds the permitted limit for an account.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// The attempted operation is not permitted.
    public static var operationNotPermittedException: Self { .init(.operationNotPermittedException) }
    /// AppStream 2.0 can’t process the request right now because the Describe calls from your AWS account are being throttled by Amazon EC2. Try again later.
    public static var requestLimitExceededException: Self { .init(.requestLimitExceededException) }
    /// The specified resource already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// The specified resource is in use.
    public static var resourceInUseException: Self { .init(.resourceInUseException) }
    /// The specified resource exists and is not in use, but isn&#39;t available.
    public static var resourceNotAvailableException: Self { .init(.resourceNotAvailableException) }
    /// The specified resource was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
}

extension AppStreamErrorType: Equatable {
    public static func == (lhs: AppStreamErrorType, rhs: AppStreamErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension AppStreamErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
